user1021984
user1021984

Reputation: 651

receive android device shutdown

How receive device shutdown? I mean any broadcast receiver for get device shutdown state.

User press shutdown button on device. Choose shutdown -> Recevier get it.

Any ideas about it?

Upvotes: 2

Views: 1525

Answers (1)

user370305
user370305

Reputation: 109257

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"

Upvotes: 2

Related Questions