Added dismiss notification when action is clicked

This commit is contained in:
Keith Holliday 2016-07-05 11:31:14 -05:00
parent 51029dacbe
commit c8b05d54b8
2 changed files with 4 additions and 4 deletions

View file

@ -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());
}

View file

@ -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