如何断电Android设备? [英] How to power off an Android device?
本文介绍了如何断电Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
怎么会关机通过java code Android设备?
它甚至有可能?我是否需要特殊的权限来做到这一点?
How could I power off an android device via java code?
Is it even possible? Do I need special permissions to do this?
推荐答案
目前在Android SDK中没有API,允许用户应用程序来做到这一点。
There is no API in the Android SDK to allow user apps to do this.
最近,你也许可以尝试将<一href="http://developer.android.com/reference/android/os/PowerManager.html#goToSleep%28long%29"><$c$c>PowerManager.goToSleep()$c$c>.
The closest you could perhaps try would be PowerManager.goToSleep()
.
这篇关于如何断电Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文