1
votes

I'm making a custom lock screen. I have used the following flags for my activity.

FLAG_DISMISS_KEYGUARD

FLAG_SHOW_WHEN_LOCKED

So when I unlock my lockscreen, the keyguard still shows if you have a code on your phone.

Now I want to be able to open another app from my lockscreen which should also show in front of the keyguard. When this app is closed, the keyguard should show again so you can't access the rest of the phone without entering the code.

Is there a way to pass these flags to the new activity? Or any other way to make the new activity appear in front of keyguard?

1

1 Answers

0
votes

I'm working on a similar application too, and I had to show two screens in front of the keyguard. (lockscreen and some other screen)

I had an issue only on Lollipop (5.0), the flags FLAG_SHOW_WHEN_LOCKED and FLAG_DISMISS_KEYGUARD did not dismissed the keyguard at all. They just let me show something I wanted without having to deal with keyguard of any kind, but as soon as I closed the previously shown screen, the keyguard was there. This behaviour is new, prior 5.0 those two flags unlocked the keyguard completely.

As for my problem, I simply set both FLAG_SHOW_WHEN_LOCKED and FLAG_DISMISS_KEYGUARD flags for both activities I want to be shown on top of the keyguard. Hope it will help you.