UNCCGameDay/src/com/uncc/gameday/alerts/AlertService.java

28 lines
585 B
Java
Raw Normal View History

2013-10-09 19:39:20 -04:00
package com.uncc.gameday.alerts;
2013-10-09 20:20:04 -04:00
import java.util.List;
2013-10-09 19:39:20 -04:00
import android.app.IntentService;
import android.content.Intent;
public class AlertService extends IntentService {
private static final String name = "AlertService";
public AlertService() {
super(name);
}
@Override
protected void onHandleIntent(Intent intent) {
// Go fetch all the alerts!
2013-10-09 20:42:44 -04:00
new AlertFetcher().fetchAlerts(this);
List<Alert> alerts = new AlertDB().fetchUnread();
2013-10-09 20:20:04 -04:00
// And then display all of them!
for (Alert a: alerts) {
2013-10-09 20:42:44 -04:00
a.displayNotification(this);
2013-10-09 20:20:04 -04:00
}
2013-10-09 19:39:20 -04:00
}
}