Runtime exception Android O with boot_completed
I'm trying to start an IntentService within my BOOT_COMPLETED receiver, but in Android O (API 26) I get: java.lang.RuntimeException: java.lang.IllegalStateException: Not allowed to start service Intent { act=intent.action.update cmp=packageName.services.OwnService }: app is in background (Message is in one line, but this way it's easier readable) How can I do this the correct way? Here are some options that I outlined in a blog post : Workaround #1: startForegroundService() Your BroadcastReceiver that receives the ACTION_BOOT_COMPLETED broadcast could call startForegroundService() instead of