I am design a apps about alarm clock.
How can I display a dialog even the phone is locked?
I don't want the phone to be unlock. I just want it to display some text on the phone. User need to unlock the phone by themselves on hand for more information.
It is not necessary to use dialog. All I want is just some text to be display.
Thanks you!
on your activity, add those flags:
public void onAttachedToWindow() {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With