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
19
votes
5 answers

Couldn't expand RemoteViews

I try to create a custom notification but getting the following exception: FATAL EXCEPTION: main android.app.RemoteServiceException: Bad notification posted from package com.my.app: Couldn't expand RemoteViews for:…
samo
  • 373
  • 3
  • 8
  • 23
19
votes
5 answers

Android Multiple Notifications and with multiple intents

I have a fairly simple app that takes the input from a user and then sets it as a notification. The user can create as many notifications as he/she likes. I want the user to click the notification and get taken to a new activity called…
EGHDK
  • 17,818
  • 45
  • 129
  • 204
19
votes
6 answers

Android notification with buttons on it

I'm trying to make a notification with 2 buttons on it: one takes me back to the activity the other closes it Has anyone got an idea on how to catch the button click event (remember that the Activity is paused)?
doronsl
  • 259
  • 1
  • 3
  • 5
18
votes
5 answers

Android Notification.PRIORITY_MAX is deprecated what is the alternative to show notification on top?

How to show android notification on top? setPriority(Notification.PRIORITY_MAX) as Notification.PRIORITY_MAX is deprecated what is the alternative? NotificationCompat.Builder builder = new NotificationCompat.Builder(context) …
Ankush Kapoor
  • 513
  • 1
  • 5
  • 27
18
votes
3 answers

NotificationManagerCompat on Android Oreo

Is there a way to set channels on Android Oreo when using NotificationManagerCompat and NotificationCompat?
Razvan Cristian Lung
  • 5,661
  • 5
  • 25
  • 49
18
votes
4 answers

How to suppress notification on lock screen in Android 5 (Lollipop) but let it in notification area?

After upgrade to Android 5.0 Lollipop it started showing automatically ongoing notification on lock screen. Sometimes users don't want to see all of them so they are asking developers how to let notification in status area but hide them on lock…
18
votes
3 answers

Changing the action buttons on a notification

I have a notification that I'm trying to update by reusing the same Notification Builder, but there's no way to clear the buttons, you can only call addAction. Not using the same Builder results in the notification flashing, which is undesirable.…
Jess
  • 42,368
  • 6
  • 37
  • 51
18
votes
1 answer

How to create persistent alarms even after rebooting

Presently, I am working on app that works like "To Do Task List". I have successfully implemented the NotificationService and SchedularService in my application. Also I am getting the alerts(Notifications) at the time set for the tasks. Here are my…
Chintan Soni
  • 24,761
  • 25
  • 106
  • 174
18
votes
10 answers

Android Notification Action is not fired (PendingIntent)

I am trying to add an Notification action item in my app which is a music player. When a stream is started a notification should be triggered and an stop button for the stream should be displayed in the notfication. The notification working fine so…
18
votes
2 answers

Custom expandable notifications in Jelly Bean (4.1)

Jelly Bean added support for expandable status notification. According to http://developer.android.com/about/versions/jelly-bean.html: In addition to the templated styles, you can create your own notification styles using any remote View. How…
RobB
  • 335
  • 1
  • 3
  • 11
18
votes
4 answers

How to properly update a notification post api 11?

Before Notification.Builder came into existence the way to update a notification that was already in the notification tray was to call setLatestEventInfo() and then send the notification back through the NotificationManager.notify() call with an ID…
cottonBallPaws
  • 21,220
  • 37
  • 123
  • 171
17
votes
2 answers

How to run a function when a notification is received with Firebase Messaging ^8.0.0-dev.8 in Flutter?

Hello I'm using Flutter to build my app and I need to to show an alert whenever a new notification is received. I've been using firebase_messaging 7.0.3 but I run into an error with onBackgroundMessage. A quick Google search helped me find out that…
17
votes
3 answers

Intent to open the Notification Channel settings from my app

What's the Intent that I need to send in order to open the settings of a Notification Channel that I've previously created in my app? I need to link to it from my app.
17
votes
3 answers

Android O and background limits prevents simple alarm notification

My own app uses the exact same technique as shown by Google I/O app of 2016. see source I need to remind users at a very specific point in time - using a notification. For this, I use the AlarmManager to wake the device at the correct point in…
Zordid
  • 10,451
  • 11
  • 42
  • 58
17
votes
1 answer

Why is this NotificationListenerService not working

I'm fighting against the NotificationListenerService without much luck. I tried a lot of recipes found here and there, especially on so... But it works quite inconsistently. A first look at the code : Manifest :
JBA
  • 2,889
  • 1
  • 21
  • 38