开发者

How can i handle ACTION_SHUTDOWN event on HTC desire for Power off option

I have registered broadcast to receive ACTION_SHUTDOWN , its working 开发者_开发知识库properly on all devices

However on HTC desire it's not getting called in case of Power off.

In case of Restart, the ACTION_SHUTDOWN is getting triggered.

What Action do I need to check to handle the same case for 'Power off' option? I want to do same operations what i did for restart option.


When you Power Off phone goes in sleep mode, not real shutdown. So ACTION_SHUTDOWN doesn't broadcasted.


Your device shutdown receiver should register for both these intents:

  1. "android.intent.action.ACTION_SHUTDOWN"
  2. "com.htc.intent.action.QUICKBOOT_POWEROFF" (Some posts have wrongly stated "android.intent.action.QUICKBOOT_POWEROFF")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜