BroadcastReceiver not working when app is installed on sd card

自古美人都是妖i 提交于 2019-12-02 21:53:30

问题


I am creating a EventsManager app in which i have a BroadcastReciver which executes for BOOT_COMPLETED broadcast.this receiver has been used to re-register all the events with AlarmManager.If the app is installed on phone's memory the it works fine but in the case of sd card BOOT_COMPLETED broadcast is not being delivered to broadcast receiver. pls help..


回答1:


Quoting the documentation:

In order for your application to consistently behave as expected, you should not allow your application to be installed on the external storage if it uses any of the following features... The system delivers the ACTION_BOOT_COMPLETED broadcast before the external storage is mounted to the device. If your application is installed on the external storage, it can never receive this broadcast.

Hence, you cannot allow your app to be installed to external storage.



来源:https://stackoverflow.com/questions/9556944/broadcastreceiver-not-working-when-app-is-installed-on-sd-card

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