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
}
精彩评论