bootcompleted

Runtime exception Android O with boot_completed

拟墨画扇 提交于 2019-11-27 19:41:57
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

Runtime exception Android O with boot_completed

人走茶凉 提交于 2019-11-26 19:58:12
问题 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

Android BOOT_COMPLETED not received when application is closed

不羁岁月 提交于 2019-11-26 15:12:09
I am aware that this question has been asked a lot on the site, however, I cant seem to find a solution. My BOOT_COMPLETED receiver is not called when the application is not running. Manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.startuptest" android:versionCode="1" android:versionName="1.0" android:installLocation="internalOnly"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" /> <application android:allowBackup="true" android:icon="@drawable/ic

BOOT_COMPLETED not working Android

你说的曾经没有我的故事 提交于 2019-11-26 11:16:44
First of all, i know there has been hundreds of this kind of question asked, but i've been checking them all for a while and still couldn't find any solution. I've seen this answer said BOOT_COMPLETED not send to application unless user launch your application first, after Android version 3.1 But i still see some applications are doing that, there must be a way. I really need to handle it, otherwise i'm also against to do something without user's interaction. So here's my AndroidManifest: <manifest ... > <!-- to be activated service on boot is completed --> <uses-permission android:name=

BOOT_COMPLETED not working Android

空扰寡人 提交于 2019-11-26 02:19:31
问题 First of all, i know there has been hundreds of this kind of question asked, but i\'ve been checking them all for a while and still couldn\'t find any solution. I\'ve seen this answer said BOOT_COMPLETED not send to application unless user launch your application first, after Android version 3.1 But i still see some applications are doing that, there must be a way. I really need to handle it, otherwise i\'m also against to do something without user\'s interaction. So here\'s my