i want to Reboot my phone i tried
try {
Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "reboot" });
proc.waitFor();
} catch (Exception ex) {
Log.i(TAG, "Could not reboot", ex);
}
and also PowerManager see my coding but device is not rebooting in both the coding kindly give working 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");
}
});