0

I want to shutdown my android phone through my android apk. to do this I write the code then I installing my apk on my android phone. then tried the app nothing happen

Code:

   try {
       Process proc = Runtime.getRuntime().exec("shutdown -s -t " + 10);
    } catch (IOException e) {
       e.printStackTrace();
    }
   Toast.makeText(getApplicationContext(), "may it will reboot", Toast.LENGTH_LONG).show();

it displays text message only any help, please

Shahadat Hossain
  • 533
  • 7
  • 20

1 Answers1

0

You cannot do this from an ordinary SDK application. Only applications signed with the system firmware signing key can do this.

https://stackoverflow.com/a/12430612/11732119

lazy
  • 149
  • 8