Questions tagged [heads-up-notifications]

High-priority notifications introduced in Android 5.0

Heads-up notifications were introduced in Android 5.0. These notifications are high-priority notifications and are presented to users for a short period of time with an expanded layout exposing possible actions.

After this period of time, the notification retreats to the notification shade. If a notification's priority is flagged as High, Max, or full-screen, it gets a heads-up notification.

Good examples of heads-up notifications:

  • Incoming phone call when using a device
  • Alarm when using a device
  • New SMS message
  • Low battery
52 questions
16
votes
1 answer

How to cancel an ongoing notification of another app?

Background I've found an app that somehow hides heads-up notifications, including even ongoing notifications (used by foreground services), called NCleaner . I was wondering how such a thing works. The problem There isn't much information of how to…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
10
votes
2 answers

Firebase Messaging - Create Heads-Up display when app in background

With FCM I receive push notifications in the system tray when the app is in the background or not running. When the app is in the foreground I can override onMessageReceived and create my own heads-up notification with NotificationCompat. Is there a…
9
votes
0 answers

Android O: disable heads-up

My application could play some audio. Once user press at the audio title the notification with the play/pause/rewind buttons appears at the notification drawer. I noticed that in Android O (8) this notification appears with "heads-up" effect. I…
9
votes
1 answer

How do some apps block/replace heads-up notifications?

Background Ever since heads-up notifications appeared on Android, some people liked it for its quick handling, yet some hated it for showing on top of apps (especially games). In order to show heads-up notifications, developers can use something…
android developer
  • 114,585
  • 152
  • 739
  • 1,270
9
votes
1 answer

Notification Action without starting new Activity?

I plan to have a heads up notification that has two Actions: one to Approve a login request and one to Decline a login request. By clicking on either of these actions I wish to fire off a HTTP request to my server and most importantly do not want to…
8
votes
1 answer

Setting small icon in Notification above lollipop version

I have created heads up notification. As like below, NotificationCompat.Builder notification = new NotificationCompat.Builder(this, channelId) .setContentTitle("Message") .setContentText("Recieved Successfully") …
8
votes
0 answers

How to enable heads-up notifications on Xiaomi (MIUI 10 Global)

How to enable heads-up notifications programatically on Xiaomi devices? Some apps (for example Telegram) have this permisstions turned on by default. Settings screenshot:…
8
votes
2 answers

How to detect headsup notification in uiautomator?

I am working with Nexus 5 and Cyanogen One plus devices with Lollipop android OS. I am trying to test various notifications of certain app. I was successfully able to test tray notification and lock screen notification with UiAutomator but I am not…
6
votes
4 answers

Heads up notification using FCM

Do we have any way to show heads up notification, when receive push from Firebase Cloud Messaging? In foreground it is possible using Notification. But there is no way to show heads up notification, when app in background, because onMessageReceived…
6
votes
1 answer

Is it possible to move a notification from heads-up to the status bar?

Background Android Lollipop (API 21) introduced a way to show notifications outside of the status bar (AKA "notifications bar"), so that the user can handle them right away. It's called "Heads-up notifications". The trigger for showing them may vary…
5
votes
1 answer

Flutter Firebase: Heads up notification not showing on background

When receiving an FCM from cloud functions in a Flutter app, on iOS the notification appears with a banner and in the system tray as expected. However, on Android the notification appears straight in the system tray without displaying a banner, when…
5
votes
3 answers

Notification Duration for HeadsUp

Is it possible to set the duration of the headsup notification to unlimited? right now its displayed just for 5 seconds. Already tried different things like changing the category. But the duration always is 5 seconds. Here is my code: Notification…
Serdar Nur
  • 63
  • 1
  • 7
5
votes
7 answers

Android Heads-up notification disappears after a few seconds

I would that the notification does not disappear after a few seconds. So i have create the notification like this: NotificationCompat.Builder builder = new NotificationCompat.Builder(context); …
javierZanetti
  • 288
  • 4
  • 17
5
votes
3 answers

Extend Lollipops "heads-up" notification duration

Been trying to find a way to create a persistent heads up notification, exactly like receiving a phone call or hangouts call. Are these restricted to Google/system apps? I've tried: Updating the notification before the heads up notification is…
4
votes
0 answers

Not getting heads up notifications for a while when you swipe up local notifications

When I swipe up after the local notification comes, the application notifications don't appear on the screen for a while. What could be the reason for this? I've read something that when heads up notifications are swiped up, it sends a warning to…
1
2 3 4