0

我目前正在使用此代码重新启动我的 Android 设备:

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

现在,我想在HotBoot (or "Hot Reboot")我的 Android 手机上使用 Java。有谁知道这样做的方法?

(如果您不知道 HotBoot 是什么,请参考此链接

4

1 回答 1

5

您将需要一部有根电话。(以防万一)

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();
}
于 2012-09-30T06:57:17.340 回答