开发者

Can I get information when locked in a Android App

开发者 https://www.devze.com 2023-01-14 02:27 出处:网络
I开发者_开发百科 developed a android appli. It\'s a widget. and I wanna get information whether the display locked or not.

I开发者_开发百科 developed a android appli. It's a widget. and I wanna get information whether the display locked or not. How can I do?


KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);

boolean isDisplayLocked = keyguardManager.inKeyguardRestrictedInputMode();

if (isDisplayLocked) {

  //your code

}
0

精彩评论

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