PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile 2024 → Reboot phone
Reboot phone
Started by Nicu, Sep., 30 2016 3:00 PM - No answer
Posted on September, 30 2016 - 3:00 PM
Hello,
I try to reboot my device, useing this code

Context thisActivity = getContexteApplication();
Intent shutdown = new Intent("android.intent.action.ACTION_REQUEST_SHUTDOWN");
shutdown.putExtra("android.intent.extra.KEY_CONFIRM", true);
shutdown.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
thisActivity.startActivity(shutdown);

The device is rooted but this code is not working does anyone knows how i can reboot an device?
or how can i run an shell comand in windev mobile ?

Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c","reboot now"});