2012-09-14 51 views
-1

我目前使用此代碼,以重新啓動我的Android設備:編程HotBoot(熱重啓)Android設備

try { 
    Process proc = Runtime.getRuntime() 
        .exec(new String[]{ "su", "-c", "reboot" }); 
    proc.waitFor(); 
} catch (Exception ex) { 
    ex.printStackTrace(); 
} 

現在,我想用Java來HotBoot (or "Hot Reboot")我的Android手機。有沒有人知道一種方法來做到這一點?

(如果你不知道HotBoot是什麼,refer to this link

回答

4

您將需要一個根深蒂固的手機。 (萬一)

su 
busybox killall system_server 

或與您的代碼

try { 
Process proc = Runtime.getRuntime() 
      .exec(new String[]{ "su", "-c", "busybox killall system_server"}); 
    proc.waitFor(); 
} catch (Exception ex) { 
    ex.printStackTrace(); 
}