My BroadcastReceiver is not receiving the BOOT_COMPLETED intent after my N1 boots

给你一囗甜甜゛ 提交于 2019-11-28 11:21:49
Nikolai Samteladze

All the applications that receive the BOOT_COMPLETED broadcast must be installed on the internal storage because Android delivers ACTION_BOOT_COMPLETED broadcast before the external storage is mounted to the device.

To ensure that your application will be installed on the internal memory you just need NOT to declare the android:installLocation manifest attribute.

Another option is to set the following in the manifest section: android:installLocation="internalOnly"

You can find more information about it here.

EDIT: Forget everything, I've found a better explanation.

You have to define your receiver with exported = true and enabled = true

<receiver android:name="com.jerrellmardis.umbrella.receiver.WeatherStartupReceiver"
  android:enabled="true" 
  android:exported="true" 
>

I think that if you change this line

<receiver android:name="com.jerrellmardis.umbrella.receiver.WeatherStartupReceiver">

for this

<receiver android:name=".WeatherStartupReceiver">

it will fix your problem.

I tried it on one of my projects and it didn't start.

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