這邊有說明一下 shutdown process:
- http://kobablog.wordpress.com/2011/07/16/shutdown-sequence-of-android/
- http://hi.baidu.com/jsxhxcq/blog/item/0933ae618376f0e8f6365451.html
使用標準的 shutdown process的話,app 還可以收到 shutdown message:
http://stackoverflow.com/questions/5076410/how-to-know-device-is-power-off
copy 一下 回答的部份:
public static final String ACTION_SHUTDOWN
Since:
API Level 4 Broadcast Action:
Device is shutting down. This is broadcast when the device is being shut down
(completely turned off, not sleeping). Once the broadcast is complete, the final
shutdown will proceed and all unsaved data lost.
Apps will not normally need to handle this, since the foreground activity will
be paused as well. This is a protected intent that can only be sent by the system.
Constant Value: "android.intent.action.ACTION_SHUTDOWN"
This would appear to be it?
I just Googled your command and it was on the Standard Broadcast Actions list. :
ref: http://developer.android.com/reference/android/content/Intent.html#ACTION_SHUTDOWN
沒有留言:
張貼留言