Restart android device programmatically
问题 In my android application, I want to restart my android device on button click. But its not working. I have done this so far. ImageButton restartmob = (ImageButton) this.findViewById(R.id.restartmob); restartmob.setOnClickListener(new ImageButton.OnClickListener() { @Override public void onClick(View v) { Process proc = null; try { //proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "reboot" }); proc = Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c","reboot now"}); proc