mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-09-28 22:21:33 -04:00
28 lines
585 B
Java
28 lines
585 B
Java
package com.uncc.gameday.alerts;
|
|
|
|
import java.util.List;
|
|
|
|
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!
|
|
new AlertFetcher().fetchAlerts(this);
|
|
List<Alert> alerts = new AlertDB().fetchUnread();
|
|
|
|
// And then display all of them!
|
|
for (Alert a: alerts) {
|
|
a.displayNotification(this);
|
|
}
|
|
}
|
|
|
|
}
|