Search code examples
javaandroidandroid-intentandroid-fullscreen

What exactly is full screen intent in android?


I've been looking up what full screen intent is, but I couldn't get a hold of what it exactly is. There are some partial code examples, but rarely I see any examples in a visible form. I got confused as I looked up what full screen intent is referring to.

From what I saw, it seems like it pops a notification bar, but not on the status bar. When the user presses the notification bar it moves on to full screen.

However, I got confused as I read this question. FullScreenIntent only appears if I clear the notification This question states that full screen intent appears when he clears the notification bar. What is full screen intent referring to? Videos in youtube seem to tell that full screen intent is about popping up a notification bar and going to a full screen activity by clicking it, but when I read the question above, I get a feeling that it's something that is separate from notification bar.

What exactly is full screen intent?


Solution

  • Lets first look at the Android doc

    An intent to launch instead of posting the notification to the status bar. Only for use with extremely high-priority notifications demanding the user's immediate attention, such as an incoming phone call or alarm clock that the user has explicitly set to a particular time. If this facility is used for something else, please give the user an option to turn it off and use a normal notification, as this can be extremely disruptive.

    The system UI may choose to display a heads-up notification, instead of launching this intent, while the user is using the device.

    and this with code example

    Your app might need to display an urgent, time-sensitive message, such as an incoming phone call or a ringing alarm. In these situations, you can associate a full-screen intent with your notification. When the notification is invoked, users see one of the following, depending on the device's lock status:

    • If the user's device is locked, a full-screen activity appears, covering the lockscreen.
    • If the user's device is unlocked, the notification appears in an expanded form that includes options for handling or dismissing the notification.

    Little bit of Explanation Back in the old days of android, if there is anything urgent in the app, you could start an activity directly from the background. But eventually, that got obsolete and you have to post a notification so that a user interaction is needed to bring an activity to foreground.

    However, the status bar notifications are not always the best UX if it is an urgent tasks (like accepting incoming calls in a dialer app). So an full-screen intent can be useful here. It will work very similar to the status bar notification intent, but if the user's device is locked, then you have the capability of showing the notification in a full-screen.