Programmatically switching off Android phone

后端 未结 6 1787
清歌不尽
清歌不尽 2020-11-22 13:02

Can we switch off an Android phone programmatically?

I am using following snippet but it didn\'t work for me.

KeyguardManager keyguardManager = (Keyg         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 13:45

    You cannot do this from an ordinary SDK application. Only applications signed with the system firmware signing key can do this.

提交回复
热议问题