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