开发者

How to call power off,reboot dialog from application?

I would like to call power off,reboot, etc.. dialog as same as default android dialog when push power button long from my application.

I no need to cal开发者_Python百科l directly reboot,power off, etc... from my application.

Just would like to call that dialog.

How to call it ? or How to send power button key on application ?

Thanks in advance.


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.

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.


It is not possible programatically due to security restriction

  • Similar Question
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜