Reboot code is not work for me
<p>I used below sample code to restart my mobile by programattically but it won't work for me. Kindly suggest here what's the wrong i did?</p>

<p><strong>Reboot.java</strong></p>

<pre><code>public class Reboot extends Activity implements View.OnClickListener {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

        ((ImageButton) findViewById(R.id.restartButton))
                .setOnClickListener(this);
    }

    public void onClick(View v) {
        try {
            Process proc = Runtime.getRuntime().exec(
                    new String[] { "su", "-c", "reboot" });
            proc.waitFor();
        } catch (Exception ex) {
            Log.i("Reboot Code", "Could not reboot", ex);
        }

        //This method also i did, kindy un comment this code and then check
        // try {
        // Runtime.getRuntime().exec(
        // new String[] { "/system/bin/su", "-c", "reboot now" });
        // } catch (IOException e) {
        // e.printStackTrace();
        // }
    }

}
</code></pre>

<p><strong>Manifest.xml</strong></p>

<pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bootup_sample_app"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk
        android:minSdkVersion="4"
        android:targetSdkVersion="15" /&gt;

    &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
    &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
    &lt;uses-permission android:name="android.permission.REBOOT"/&gt;

    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" &gt;
        &lt;activity
            android:name=".Reboot"
            android:label="@string/title_activity_main" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;

&lt;/application&gt;

&lt;/manifest&gt;
</code></pre>
