我怎样才能打开电源关闭Android上对话?电源、Android

2023-09-12 06:03:30 作者:煙花消散ぐ記憶殘〃

我怎样才能在我的PROGRAMM在Android开放系统关机(电话选项)对话框?

How can I open system Power off (Phone options) dialog in my programm on Android?

推荐答案

如果你看一下源$ C ​​$ C,你会看到它的内部处理(PhoneWindowManager.java和GlobalActions.java)。还有就是通过API接口没有任何。总之:不能做

If you look at the source code, you'll see it's handled internally (PhoneWindowManager.java and GlobalActions.java). There is no interface whatsoever through the API. In short: Can't be done.

如果您有重新启动的许可,您可以直接与PowerManager.reboot()重启手机,但它是不太可能公开的应用程序将需要此功能。我不相信一个应用程序与重新启动的权限。

If you have the REBOOT permission, you can reboot the phone directly with PowerManager.reboot(), but it is very unlikely that a public app would need this functionality. I wouldn't trust an app with the REBOOT permission.