BOOT_COMPLETED intent not received on all devices

孤街浪徒 提交于 2019-11-28 09:54:07

问题


I have created an application that receives BOOT_COMPLETED within a receiver using the following filter:

<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />

I receive this on one device but I have another device that does not receive this despite using the same APK. What device-specific issues could prevent a particular device from receiving this intent? Is there any way to test for this and create a remedy?


回答1:


Make sure that you are doing a real full reboot.

Some HTC devices, for example, have a "fast boot" mode that does not trigger BOOT_COMPLETED, but instead sends an android.intent.action.QUICKBOOT_POWERON broadcast. As I understand it, the "fast boot" mode basically does a hibernate, instead of a true power down, and so they don't send BOOT_COMPLETED as a result.

(why the Intent action isn't com.htc.action.QUICKBOOT_POWERON is a whole `nuther issue...)




回答2:


Some devices after Android 3.1 will not give the app control after the BOOT_COMPLETED receiver.

Google has long said that users should launch an activity from the launcher first, before that application can go do much. Preventing BOOT_COMPLETED from being delivered until the first activity is launched is a logical extension of the same argument.

I do not know which devices it makes a difference on though.



来源:https://stackoverflow.com/questions/17221679/boot-completed-intent-not-received-on-all-devices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!