【问题标题】:Reboot android device programmatically [duplicate]以编程方式重新启动android设备[重复]
【发布时间】:2011-06-28 10:40:17
【问题描述】:

可能重复:
Reboot the phone on a button click

是否可以以编程方式重新启动设备。

我只想通过单击按钮重新启动设备。

【问题讨论】:

  • 你试过什么?什么没用?您收到了哪些错误消息?

标签: android restart reboot


【解决方案1】:

请尝试

try {
Runtime.getRuntime().exec("su");
  Runtime.getRuntime().exec("reboot");
} catch (IOException e) {
}  

【讨论】:

  • 不工作,我的手机已经root了,它不工作。
  • This answer 为我工作:Runtime.getRuntime().exec(new String[]{"/system/bin/su","-c","reboot now"});
猜你喜欢
  • 2011-06-02
  • 2020-12-23
  • 1970-01-01
  • 1970-01-01
  • 2016-01-04
  • 2011-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多