关机和重启

confirm:ture-会弹出是否关机的确认窗口,false-无弹框,直接关机
public void systemShutdown(boolean confirm) {
    Intent intent = new Intent("android.ido.intent.action.set.shutdown");
    intent.putExtra("confirm", confirm);
    sendBroadcast(intent);
}
confirm:ture-会弹出是否关机的确认窗口,false-无弹框,直接重启
public void systemReboot(boolean confirm) {
    Intent intent = new Intent("android.ido.intent.action.set.reboot");
    intent.putExtra("confirm", confirm);
    sendBroadcast(intent);
}
文档更新时间: 2021-01-29 17:47   作者:Aeeditor