title: after app exit, reboot device on android
body: <p>I want after app exit, reboot my device on android</p>
  
  <p>I try app exit this.</p>
  
  <pre><code>moveTaskToBack(true);
  finish();
  android.os.Process.KillProcess(android.os.Process.myPid());
  </code></pre>
  
  <p>it is app exit normal work.</p>
  
  <p>and I try reboot this.</p>
  
  <pre><code>static Process rebootProcess;
  try {
       rebootProcess = Runtime.getRuntime().exec(new String[]{"su", "-c", "poweroff"});
  } catch (IOException e) {
   e.printStackTrace();
  }
  </code></pre>
  
  <p>Each of the well operation</p>
  
  <p>but add reboot code , app exit code .</p>
  
  <p>only app exit code operation</p>
  
  <pre><code>moveTaskToBack(true);
  finish();
  android.os.Process.killProcess(android.os.Process.myPid());
      try {
         rebootProcess = Runtime.getRuntime().exec(new String[]{"su", "-c", "poweroff"});
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>I try run this code.</p>
  
  <p>only work app exit.</p>
  
  <p>in other words. after app exit. not reboot.</p>
  
  <p>How I programmatically on android ?</p>
  
  <p>thanks. </p>
  
  <p>please advice for me </p>