I need your help to resolve this problem :
Context.startForegroundService() did not then call Service.startForeground()
I'm using a BroadcastReceiver to start the notification service :
@Override
public void onReceive(Context context, Intent intent) {
WakeLock.acquire(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
ContextCompat.startForegroundService(context, new Intent(context, StartNotificationService.class).putExtras(intent));
} else {
context.startService(new Intent(context, StartNotificationService.class).putExtras(intent));
}
}
Have you any idea please ? How can I resolve this issue ? Thanks you