Is there a direct event to lock the keypad lock?

DUPLICATE WARNING : this post does NOT touch the on / off screen , this post is a keypad lock (these problems do not match).

Fortunately, there is a direct situation where keyguard is unlocked, but what about the event when the key lock is locked? I searched the list of Android API events back and forth and I just donโ€™t see it (the phrase โ€œlockโ€ is not, the phrase โ€œkeyguardโ€ is one, for the status is โ€œoffโ€).

I know a workaround - wait for the event with the screen turned off, check the lock status of the keyboard in a cycle and wait for the event to appear on the screen, because the phone can work in only two directions, starting from the screen - either the phone will be locked or the screen will turn on again. Not a huge amount of code, but hack anyway, so I hope that something is missing in the manual, and there is a direct event to lock the keypad lock.

+4
source share

Source: https://habr.com/ru/post/1437452/


All Articles