Here you can find the source of rebootSystemNow()
public static void rebootSystemNow()
//package com.java2s; import java.io.DataOutputStream; import java.io.IOException; public class Main { /**//from w w w . j a v a 2s. c o m * Function hot reboot system */ public static void rebootSystemNow() { String[] commands = { "-c", "busybox killall system_server" }; try { runAsRoot(commands); } catch (IOException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } public static void runAsRoot(String[] commands) throws IOException, InterruptedException { Process p = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(p.getOutputStream()); for (String cmd : commands) { os.writeBytes(cmd + "\n"); } os.writeBytes("exit\n"); os.flush(); os.close(); p.waitFor(); } }