开发者

Track restarts, shuts down, power up and power down

开发者 https://www.devze.com 2023-02-21 06:42 出处:网络
can we get notification if user restarts, shuts down, power u开发者_StackOverflow社区p or down the deviceAjay,

can we get notification if user restarts, shuts down, power u开发者_StackOverflow社区p or down the device


Ajay,

The two Broadcast Actions you are most likely interested in are:

  • ACTION_BOOT_COMPLETED: This is broadcast once, after the system has finished booting.
  • ACTION_SHUTDOWN: Device is shutting down. This is broadcast when the device is being shut down (completely turned off, not sleeping).

Please keep in mind to receive ACTION_BOOT_COMPLETE you must have the RECEIVE_BOOT_COMPLETED permission in your AndroidManifest.xml

0

精彩评论

暂无评论...
验证码 换一张
取 消