Trying random things to try to fix ForegroundServiceStartNotAllowedException

This commit is contained in:
Albert Vaca Cintora
2023-07-08 00:24:17 +02:00
parent ea80000a4e
commit f54ebdb39b

View File

@@ -206,6 +206,7 @@ public class BackgroundService extends Service {
.setContentIntent(pi)
.setPriority(NotificationCompat.PRIORITY_MIN) //MIN so it's not shown in the status bar before Oreo, on Oreo it will be bumped to LOW
.setShowWhen(false)
.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
.setAutoCancel(false);
notification.setGroup("BackgroundService");