0

I try to show alert when screen is locked I googled about screen locked but i do not know how i can check when screen is locked. I found one post but i do not know how this method working this post

getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

But I don't know how to show alert when screen is locked, If anyone knows solution please help me.

Community
  • 1
  • 1
user3345767
  • 349
  • 1
  • 2
  • 11

1 Answers1

0

You might just use a toast:

Toast.makeText(appcontext, msg, Toast.LENGTH_LONG).show();

Or if you really need a popup, then why not just remove this flag temporarily from your screen while the popup is displayed?