Questions tagged [android-notifications]

A status notification adds an icon to the system's status bar (with an optional ticker-text message) and a notification message in the notifications window.

A notification is a user interface element that you display outside your app's normal UI to indicate that an event has occurred. Users can choose to view the notification while using other apps and respond to it when it's convenient for them.

Think of notifications as a news channel that alerts the user to important events as they happen or a log that chronicles events while the user is not paying attention. The user can expand the notification bar and by selecting the notification the user can trigger another activity. Notifications in Android are represented by the Notification class. To create notifications you use the NotificationManager class which can be received from the Activity via the getSystemService() method.

Useful links

4920 questions
11
votes
1 answer

Android Notification at time

I am looking for hours now how to do this exactly: I want that every day (except weekends) a notification is sent at a time (let's say 18:00 (= 6pm)) except for when the app is open already. It's basically like the gmail app when you receive a…
11
votes
1 answer

How to use NotificationCompat.Builder and startForeground?

Short question: I'm trying to use the NotificationCompat.Builder class in order to create a notification that will be used for the service, but for some reason, i either don't see the notification, or can't cancel it when the service should be…
10
votes
4 answers

Android notification at specific date

I have to create an app in which I must set a date and at that specific date at 9 O'clock, I must give a notification. What is the simplest method of doing this? I want the app to work even when the app gets killed anyway. Is AlarmManager a…
Buze
  • 129
  • 1
  • 1
  • 6
10
votes
5 answers

Android notification not working

I've been attempting to get a notification of a successful upload from an ASyncTask to work all day. I'm not getting any errors from my current code but I can't get the notification to show in the notification bar (or anywhere else). I get no…
Carnivoris
  • 793
  • 3
  • 7
  • 23
10
votes
2 answers

Android Notification MediaStyle Ignores Ongoing Flag

I am attempting to employ a MediaStyle notification in an audio Android application as discussed in the audio app documentation as well as in the media style documentation. I am able to successfully show a notification with functional transport…
10
votes
2 answers

Android notification icon is blank on some devices

I have been getting a blank/grey notification icon on some Android devices (Pixel 2 XL and Pixel 5 - both Android 11), but it shows up fine on other Android devices I tested on (Huawei P20 & P30 - both Android 10). Has anyone else come across this…
10
votes
5 answers

Android full screen notification won't show over the lock screen

I'm trying to create an android full screen notification to show an activity over the lock screen, like an alarm clock. The notification always occurs, but the activity is never started over the lock screen; it just rings and shows a notification…
10
votes
4 answers

Disable or hide seekbar in MediaStyle notifications

Trying to build a live stream media playback app, the media style notifications in 28 and below sdk looks good without any seekbar, but when running same application in Android 10 (SDK 29) the notification is showing additional seekbar which i don't…
MDT
  • 1,535
  • 3
  • 16
  • 29
10
votes
2 answers

Android Notification with Actions and a DropDown Menu

Android's Google app has a Notification which shows the local weather for example. If you swipe left on the notification, it shows a "clock icon"-action (e.g. Snooze) as shown below. If you click on the clock, the following dropdown menu…
the_dani
  • 2,466
  • 2
  • 20
  • 46
10
votes
3 answers

Android local notifications not working for samsung galaxy

I'm struggling with complex local notifications on Android for a long time now. I have a list of events. The user is able to choose when he/she would like to be notified: on the same day of the event one day before the event starts two days before…
novas1r1
  • 1,803
  • 21
  • 28
10
votes
1 answer

Android: Is there a way to disable notification bundling?

I have an app where the user can receive multiple notifications for things they need to do. The user has a choice of making some of these notifications persistent (which I achieve by calling NotificationCompat.Builder.setOngoing). At least on my…
Nir Arbel
  • 215
  • 1
  • 3
  • 11
10
votes
5 answers

How to preserve current back stack (or task) when notification is clicked?

In my application, I create a notification which starts Details Activity. I want to add this activity to top of current task (or back stack). For example I expect application task (back stack) to behave like this: but I get this: I have not used…
h.nodehi
  • 1,036
  • 1
  • 17
  • 32
10
votes
3 answers

Can FCM notification on Android overwrite previous one?

I'm using FCM to send notifications to Android devices. When the app is in background, if I send 10 notifications, the devices will show up 10 entries on the notification bar. I want FCM to make only one entry on notification bar, i.e. the newer one…
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…
10
votes
1 answer

Android Lock Screen Notification Custom View with Ripple and Double Tap

I am working on an Android app. This last makes use of a notification with a custom view that is displayed on the lock screen. Unfortunately, I am not able to get the ripple and elevation effect when I tap on it like other notifications. Also, a…
Laurent
  • 14,122
  • 13
  • 57
  • 89