I am writing an application to control or customize the unlock screen of Android devices. It works in the following steps:
- The user locks the screen using the power button.
- The user tries to unlock the screen, thereby again pressing the power button.
- My activity pops up - the screen is still locked
- The user answers the question, and if the answer is correct, the screen unlocks
I created an action for the third step and added the following code to its method onCreate:
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.addFlags(WindowManager.LayoutParams.FLAG_SECURE);
This works correctly and accurately, as I had hoped. My problem is the fourth step. I searched and found a number of solutions, but none of them do this for me.
/ - . .
/ Android - , . , . , , . (!)
. . , .