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

32 lines
700 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;
import com.uncc.gameday.GameDay;
2013-10-09 19:39:20 -04:00
import android.app.IntentService;
2013-10-09 20:20:04 -04:00
import android.content.Context;
2013-10-09 19:39:20 -04:00
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:20:04 -04:00
Context appContext = GameDay.getAppContext();
AlertDB dbHandle = new AlertDB();
List<Alert> alerts = dbHandle.fetchUnread();
// And then display all of them!
for (Alert a: alerts) {
a.displayNotification(appContext);
}
2013-10-09 19:39:20 -04:00
}
}