PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV Mobile 2024 → Reboot phone
Reboot phone
Iniciado por Nicu, 30,sep. 2016 15:00 - No hay respuesta
Publicado el 30,septiembre 2016 - 15:00
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"});