开发者

Can I get information when locked in a Android App

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜