From f92c861764a6c2547e0dae28c76f3459f8822d33 Mon Sep 17 00:00:00 2001 From: jacques Date: Sat, 15 Aug 2020 22:04:03 +0200 Subject: [PATCH] Small refactoring, add setAutoCancel(true) --- .../main/java/net/foucry/pilldroid/NotificationPublisher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/net/foucry/pilldroid/NotificationPublisher.java b/app/src/main/java/net/foucry/pilldroid/NotificationPublisher.java index 0724610..a59a367 100644 --- a/app/src/main/java/net/foucry/pilldroid/NotificationPublisher.java +++ b/app/src/main/java/net/foucry/pilldroid/NotificationPublisher.java @@ -55,6 +55,7 @@ public class NotificationPublisher extends BroadcastReceiver { .setChannelId(APP_NAME) .setStyle(new NotificationCompat.BigTextStyle() .bigText(context.getString(R.string.pharmacy))) + .setAutoCancel(true) .setPriority(NotificationCompat.PRIORITY_DEFAULT); if (isEnableSound) { @@ -62,6 +63,7 @@ public class NotificationPublisher extends BroadcastReceiver { builder.setSound(alarmSound); } + notificationManager.notify(notificationId, builder.build()); }