From fc155f0ba8f231872ae85eac37621c2ed60ae328 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 7 May 2021 14:37:54 +0100 Subject: [PATCH] Use notificationID as requestcode to allow multiple android notifications Signed-off-by: Adam --- .../com/nextcloud/client/integrations/deck/DeckApiImpl.java | 2 +- src/main/java/com/nextcloud/client/jobs/NotificationWork.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java b/src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java index 6b4d0456a7..db0a1eb438 100644 --- a/src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java +++ b/src/main/java/com/nextcloud/client/integrations/deck/DeckApiImpl.java @@ -76,7 +76,7 @@ public class DeckApiImpl implements DeckApi { private PendingIntent createPendingIntent(@NonNull Intent intent, @NonNull Notification notification, @NonNull User user) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - return PendingIntent.getActivity(context, 0, putExtrasToIntent(intent, notification, user), + return PendingIntent.getActivity(context, notification.getNotificationId(), putExtrasToIntent(intent, notification, user), PendingIntent.FLAG_ONE_SHOT); } diff --git a/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt b/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt index e82303ef0b..ad61bf38f1 100644 --- a/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt +++ b/src/main/java/com/nextcloud/client/jobs/NotificationWork.kt @@ -156,7 +156,7 @@ class NotificationWork constructor( } intent.putExtra(KEY_NOTIFICATION_ACCOUNT, user.accountName) intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) - pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT) + pendingIntent = PendingIntent.getActivity(context, notification.getNotificationId(), intent, PendingIntent.FLAG_ONE_SHOT) } val pushNotificationId = randomId.nextInt()