How do I get android lockscreen package name

后端 未结 3 1206
遇见更好的自我
遇见更好的自我 2021-01-14 15:47

Is there a way to get the android lockscreen package name?

I want to show alert on the lockscreen using AlertDialog.Builder. So I need to know when the

3条回答
  •  天命终不由人
    2021-01-14 16:37

    Really a Simple solution.

    KeyguardManager km = (KeyguardManager) getApplicationContext().getSystemService(Context.KEYGUARD_SERVICE);
    
    if( km.inKeyguardRestrictedInputMode()) {
                   //it is locked
    
                      }
    

提交回复
热议问题