From c8b05d54b82e57bfd3e0afabfada476262f6e73f Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Tue, 5 Jul 2016 11:31:14 -0500 Subject: [PATCH] Added dismiss notification when action is clicked --- .../helpers/notifications/QuestInviteLocalNotification.java | 2 +- .../habitica/receivers/LocalNotificationActionReceiver.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/helpers/notifications/QuestInviteLocalNotification.java b/Habitica/src/main/java/com/habitrpg/android/habitica/helpers/notifications/QuestInviteLocalNotification.java index 221346c03..f87c3abd7 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/helpers/notifications/QuestInviteLocalNotification.java +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/helpers/notifications/QuestInviteLocalNotification.java @@ -52,7 +52,7 @@ public class QuestInviteLocalNotification implements HabiticaLocalNotification { ); notificationBuilder.addAction(0, "Reject", pendingIntentReject); - NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE); + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(10000, notificationBuilder.build()); } diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/receivers/LocalNotificationActionReceiver.java b/Habitica/src/main/java/com/habitrpg/android/habitica/receivers/LocalNotificationActionReceiver.java index d9527289a..506b41c67 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/receivers/LocalNotificationActionReceiver.java +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/receivers/LocalNotificationActionReceiver.java @@ -27,7 +27,7 @@ public class LocalNotificationActionReceiver extends BroadcastReceiver implement private String action; private Resources resources; private Intent intent; - private Context conext; + private Context context; @Override public void onReceive(Context context, Intent intent) { @@ -36,7 +36,7 @@ public class LocalNotificationActionReceiver extends BroadcastReceiver implement this.action = intent.getAction(); this.intent = intent; - this.conext = conext; + this.context = context; this.apiHelper.apiService.getUser() .compose(this.apiHelper.configureApiCallObserver()) @@ -50,7 +50,7 @@ public class LocalNotificationActionReceiver extends BroadcastReceiver implement } private void handleLocalNotificationAction(String action) { - NotificationManager notificationManager = (NotificationManager) this.conext.getSystemService(this.conext.NOTIFICATION_SERVICE); + NotificationManager notificationManager = (NotificationManager) this.context.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.cancelAll(); //@TODO: This is a good place for a factory and event emitter pattern