1

Possible Duplicate:
Reboot the phone on a button click

Is it possible to reboot a device pro grammatically.

I just want to reboot the device on a button click.

Community
  • 1
  • 1
Droidand
  • 176
  • 1
  • 4
  • 10

1 Answers1

2

Please try

try {
Runtime.getRuntime().exec("su");
  Runtime.getRuntime().exec("reboot");
} catch (IOException e) {
}  
Nikhil
  • 16,194
  • 20
  • 64
  • 81
  • 1
    Not working, and my phone is rooted, it not working. –  Jun 17 '15 at 19:23
  • [This answer](http://stackoverflow.com/a/5768966/2128979) worked for me : `Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c","reboot now"});` – Ashish Tanna Jul 27 '15 at 23:17