Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Intent.ACTION_REBOOT and Intent.ACTION_SHUTDOWN

I am trying to receive (with BroadcastReceiver) the action of shutting down, booting and rebooting.

I searched a lot, but I could not figure out what is the difference between Intent.ACTION_REBOOT and Intent.ACTION_SHUTDOWN, and when is Intent.ACTION_REBOOT called (or should I say "broadcasted").

Can please someone explain that for me?

like image 827
Or B Avatar asked Jul 29 '13 07:07

Or B


2 Answers

Intent.ACTION_REBOOT is triggered if Reboot/Restart command initiated. This Action only can be used by System code/apps.

Intent.ACTION_SHUTDOWN :- is triggered when SHUTDOWN command is initiated or the device is being shutdown. After this Action is completed device will start shutdown process and any unsaved data will be lost.

You can also read what docs says here >> ACTION_REBOOT and ACTION_SHUTDOWN

like image 166
AAnkit Avatar answered Sep 28 '22 19:09

AAnkit


Intent.ACTION_SHUTDOWN

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.

Intent.ACTION_REBOOT

Broadcast Action: Have the device reboot. This is only for use by system code. This is a protected intent that can only be sent by the system.

like image 23
Suji Avatar answered Sep 28 '22 18:09

Suji