mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-09-27 13:41:29 -04:00
32 lines
700 B
Java
32 lines
700 B
Java
package com.uncc.gameday.alerts;
|
|
|
|
import java.util.List;
|
|
|
|
import com.uncc.gameday.GameDay;
|
|
|
|
import android.app.IntentService;
|
|
import android.content.Context;
|
|
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!
|
|
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);
|
|
}
|
|
}
|
|
|
|
}
|