Sheharyar
Sheharyar

Reputation: 75740

Programmatically HotBoot (Hot Reboot) Android Device

I'm currently using this code to Reboot my Android Device:

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

Now, I want to HotBoot (or "Hot Reboot") my Android Phone using Java. Does anyone know a way to do this?

(If you don't know what HotBoot is, refer to this link)

Upvotes: 0

Views: 3395

Answers (1)

Rotary Heart
Rotary Heart

Reputation: 1969

You will need a rooted phone. (Just in case)

su
busybox killall system_server

Or with your code

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

Upvotes: 5

Related Questions