关于用手机关闭android手机的问题 [英] Question on switch off android mobile with code

查看:87
本文介绍了关于用手机关闭android手机的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用代码关闭手机





I want to switch off the mobile with code


 try {
  String[] str ={"su","-c","reboot -p"};
  Process p = Runtime.getRuntime().exec(str);
      } catch (Exception e) {
        Log.v("Exception is ", e.toString());
}





我正在使用此代码,但获得 IOExecption



先谢谢



I am using this code but getting IOExecption

Thanks in Advance

推荐答案

除非你关掉你的手机是不可能的拥有制造商密钥来签署您的应用程序/或您的设备是否已植根。查看此 [ LINK ]了解更多信息。
It is not possible to switch off your mobile unless you have the manufacturer key to sign your app/or if your device is rooted. Check this [LINK]for more information.


这篇关于关于用手机关闭android手机的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆