mirror of
https://github.com/bspeice/UNCCGameDay
synced 2025-01-09 15:30:06 -05:00
Minor cleanups
This commit is contained in:
parent
df9e24e17c
commit
27681948fc
@ -49,7 +49,7 @@ public class Alert {
|
|||||||
public void displayNotification(Context ctx) {
|
public void displayNotification(Context ctx) {
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx)
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx)
|
||||||
.setSmallIcon(R.drawable.ic_launcher)
|
.setSmallIcon(R.drawable.ic_launcher)
|
||||||
.setContentTitle("GameDay Alert")
|
.setContentTitle(ctx.getString(R.string.app_name))
|
||||||
.setContentText(this.getMessage());
|
.setContentText(this.getMessage());
|
||||||
|
|
||||||
Intent resultIntent = new Intent(ctx, Home.class);
|
Intent resultIntent = new Intent(ctx, Home.class);
|
||||||
|
@ -18,13 +18,12 @@ public class AlertService extends IntentService {
|
|||||||
@Override
|
@Override
|
||||||
protected void onHandleIntent(Intent intent) {
|
protected void onHandleIntent(Intent intent) {
|
||||||
// Go fetch all the alerts!
|
// Go fetch all the alerts!
|
||||||
Context appContext = GameDay.getAppContext();
|
new AlertFetcher().fetchAlerts(this);
|
||||||
AlertDB dbHandle = new AlertDB();
|
List<Alert> alerts = new AlertDB().fetchUnread();
|
||||||
List<Alert> alerts = dbHandle.fetchUnread();
|
|
||||||
|
|
||||||
// And then display all of them!
|
// And then display all of them!
|
||||||
for (Alert a: alerts) {
|
for (Alert a: alerts) {
|
||||||
a.displayNotification(appContext);
|
a.displayNotification(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user