简体   繁体   中英

If android application is installed in mobile but never launched .is BootCompletedReciever called?

如果android应用程序安装在移动设备上但从未启动过,并且认为我已经为此应用程序实现了启动完成的接收器。现在我要重新启动设备。在这里启动完成的接收器将调用或会发生什么?

No You have to launch the app once to register receiver with the device. Without launching the application Device will not detect your broadcast receiver.

Set the RECEIVE_BOOT_COMPLETED permission in your application's manifest. This allows your app to receive the ACTION_BOOT_COMPLETED that is broadcast after the system finishes booting (this only works if the app has already been launched by the user at least once)

The documentation clearly states that it works only if the app has been launched at least once. So the answer of your question is NO, it wont be called.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM