mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +00:00
Added dismiss notification when action is clicked
This commit is contained in:
parent
51029dacbe
commit
c8b05d54b8
2 changed files with 4 additions and 4 deletions
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue