title: Reboot android device onClick event of Button
body: <p>i want to Reboot my phone i tried</p>
  
  <pre><code>        try {
      Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "reboot" });
      proc.waitFor();
  } catch (Exception ex) {
      Log.i(TAG, "Could not reboot", ex);
  }
  </code></pre>
  
  <p>and also PowerManager see my coding but device is not rebooting in both the coding kindly give working code</p>
  
  <pre><code>          ok = (Button)findViewById(R.id.button1);
      final PowerManager power = (PowerManager)getSystemService(Context.POWER_SERVICE);
  
      ok.setOnClickListener(new OnClickListener() {
  
          @Override
          public void onClick(View v) {
              power.reboot("fav");
          }
      });
  </code></pre>