Android Device Reboot rebootDevice()

Here you can find the source of rebootDevice()

Description

reboot Device

License

Open Source License

Declaration

static public void rebootDevice() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.DataOutputStream;

public class Main {
    static public void rebootDevice() {
        try {/*  w w  w . j  a v a  2s.c o m*/
            Process process = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(
                    process.getOutputStream());
            os.writeBytes("reboot \n");
        } catch (Throwable t) {
            t.printStackTrace();
        }
    }
}