Search code examples
androidsdkdialogshutdownreboot

SDK Android : How to open Shutdown/Reboot dialog for the device


I'm new here.

I have a problem, i try to shutdown a 4.2.2 android device (not root).

I know that ACTION_SHUTDOWN not works with unroot device.

So i want to open the existing shutdown/reboot/airplane dialog, the same we get when we maintain the on/off button. Then the user just have to click shutdown button.

I try to create by this way, without result...

Intent intent = new Intent(Settings.ACTION_DISPLAY_SETTINGS); // or others settings         
startActivity(intent);

Thanks,


Solution

  • The is no public sdk access to open the power button menu programatically.
    This link has all the approches Here.Simulating power button press to display switch off dialog box