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? 回答1: Here are some options that I outlined in a blog post: Workaround #1: startForegroundService() Your