Turning on screen programmatically

前端 未结 5 821
情话喂你
情话喂你 2020-11-29 07:23

I would like to unlock screen and switching it on to show a popup on an event trigger. I am able to unlock the screen using

newKeyguardLock = km.newKeyguardL         


        
5条回答
  •  青春惊慌失措
    2020-11-29 08:04

    I have the same issue. As these guys discussed here, there is a hidden api to turn screen on/off, see: https://android.googlesource.com/platform/frameworks/base/+/froyo-release/core/java/android/os/Power.java

    But I don't know how to call it. I have actually seen a application can turn screen on, wondering if it is device specific.

提交回复
热议问题