안녕하세요.
Application에서 단말을 재부팅시킬 수 있는 방법이 있을까요?
아시는 분이 있으시면 조언 부탁드립니다.
감사합니다. 수고하세요 : )
try { Process process = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(process.getOutputStream()); os.writeBytes("reboot\n"); os.flush(); try { process.waitFor(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
참고로 루팅 필수입니다.
오홋!
감사합니다 : )
로그인 유지
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes("reboot\n");
os.flush();
try {
process.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
참고로 루팅 필수입니다.