From 6d580380467503770ba19a53584dcc46be03cc28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gear=C3=B3id=20Moroney?= Date: Thu, 4 Jun 2015 15:29:32 +0100 Subject: [PATCH] Update existing intent rather than replace it For the use case of using the notification as a timer. If you update the notification frequently, then tapping it would typically not resume the app as the PendingIntent had been cancelled. Instead updates to the notification now update the PendingIntent rather than replacing it, which makes sense for most cases. --- src/android/ForegroundService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/ForegroundService.java b/src/android/ForegroundService.java index 21c98e0..e345c0d 100644 --- a/src/android/ForegroundService.java +++ b/src/android/ForegroundService.java @@ -177,7 +177,7 @@ public class ForegroundService extends Service { if (intent != null && settings.optBoolean("resume")) { PendingIntent contentIntent = PendingIntent.getActivity( - context, NOTIFICATION_ID, intent, PendingIntent.FLAG_CANCEL_CURRENT); + context, NOTIFICATION_ID, intent, PendingIntent.FLAG_UPDATE_CURRENT); notification.setContentIntent(contentIntent); }