Android examples for Android OS:Shell
reboot from Shell
//package com.java2s; import java.io.DataOutputStream; import java.io.IOException; public class Main { public static void reboot() { Process p;// w w w.j ava 2 s . com try { p = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(p.getOutputStream()); os.writeBytes("reboot\n"); os.writeBytes("exit\n"); os.flush(); } catch (IOException e) { e.printStackTrace(); } } }