I need to show message on top of the lock screen, like Android Alarm Clock is displaying full screen of the alarm, when it's the time to wake up.
Here is a photo of one of the screen popup when there is alarm:
I need to show message on top of the lock screen, like Android Alarm Clock is displaying full screen of the alarm, when it's the time to wake up.
Here is a photo of one of the screen popup when there is alarm:
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);
https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html
You are looking for the method setFullScreenIntent()
. This allows a notification to display over whatever is being viewed. Remember, this is only for extremely critical notifications (phone call or alarm clock) so only do this if absolutely necessary.