Android, how to determine whether a restart has occurred?

How will I programmatically determine when the Android device will restart (whether it is started individually or by the user)@ H_ 419_ 1@

Solution: @ h_ 419_ 1@

Set up a broadcastreceiver and register it in the listing to respond to Android. Intent. Action. Boot_ Completed system. When the mobile phone starts, the code in the onReceive method of the broadcast receiver will run. Make sure it generates a separate thread or takes less than 10 seconds, and the operating system will destroy your broadcast receiver thread in 10 seconds. @ h_ 419_ 1@

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>