Is there a direct event for keyguard lock?
Asked Answered
G

0

6

DUPLICATE WARNING: this post IS NOT about screen on/off, this post IS about keyguard lock (those issues are not the same).

Luckily there is a direct event when the keyguard is unlocked, but what about event when the keyguard is locked? I searched Android API event list back and forth, and I simply don't see it (phrase "lock" -- none, phrase "keyguard" -- one, for off state).

I know the workaround -- wait for screen off event, check in loop the state of keyguard AND wait for screen on event, because the phone can go only in two directions starting from screen off -- either phone will be locked or the screen will be on again. Not huge amount of code, but hack anyway, so I hope I missed something in the manual and there is direct event for keyguard lock.

Giese answered 2/10, 2012 at 19:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.