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, theACTION_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:
- "android.intent.action.ACTION_SHUTDOWN"
- "com.htc.intent.action.QUICKBOOT_POWEROFF" (Some posts have wrongly stated "android.intent.action.QUICKBOOT_POWEROFF")
精彩评论