diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.java index f68bc6e6a1..8898f798dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.java @@ -112,10 +112,11 @@ public class PersistentNotificationPlugin extends PluginBase { } private void triggerNotificationUpdate() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) - MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class)); - else - MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class)); + if (updateNotification() != null) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + MainApp.instance().startForegroundService(new Intent(MainApp.instance(), DummyService.class)); + else + MainApp.instance().startService(new Intent(MainApp.instance(), DummyService.class)); } Notification updateNotification() {