BroadcastReceiver is not being called from AndroidManifest on BOOT_COMPLETE in Android

前端 未结 1 1187
时光取名叫无心
时光取名叫无心 2021-01-29 06:58

In my Android application I want to run a Service without opening/running my application. For that I have extended BroadcastReciever class. But this

相关标签:
1条回答
  • 2021-01-29 07:43

    Remove android:exported="false" from the <receiver>. That says you do not want anyone (other than yourself) sending a broadcast to this receiver. As a result, your receiver will be ignored by the system.

    Beyond that, you also need an activity and to have run that activity before trying to reboot the device. You may already have that, but I thought that I would mention it for completeness.

    0 讨论(0)
提交回复
热议问题