开发者

Track restarts, shuts down, power up and power down

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜