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
20
votes
3 answers

Android N: How to launch activity in current active window instead of second window when click on notification in split-screen?

In Android N while using split screen I want to launch activity in current active window when user clicks on notification, but Android N always launches activity in second window if launch by clicking on notification. NotificationCompat.Builder…
20
votes
3 answers

Access application notification settings programmatically

In an Android app, I have a button that I want to have the functionality of opening the App Notification settings (in Android settings). I can open the Android settings with this startActivityForResult(new…
Thought
  • 5,326
  • 7
  • 33
  • 69
20
votes
1 answer

Couldn't expand RemoteViews: MediaSessionCompat and NotificationCompat.MediaStyle on HUAWEI devices

My app crashes when I try to display an Notification on my HUAWEI P8 lite device running Android 5.0.1 (it works fine on Nexus and Samsung devices). Most of my code is taken from the video Media playback the right way (Big Android BBQ 2015) by Ian…
20
votes
1 answer

How to implement dialog like truecaller

I am trying to implement the app similar to true caller,I am able to get the phone number when the phone rings using broadcast receiver and opening the MyCustomDialog Activity This is my receiver class by which I am getting the Call State that the…
Kushal
  • 795
  • 1
  • 5
  • 23
20
votes
2 answers

Android: Is it possible to get other apps notification info?

I have question about Accessibility Service in Android. Can I catch a notification in status bar and get info from notification? My purpose is to catch notification of apps like Viber, Skype. Is that possible?
smail2133
  • 936
  • 2
  • 7
  • 24
20
votes
4 answers

Set Drawable or Bitmap as icon In Notification in Android

I download a image from server as bitmap and convert it to drawable now i want to use this drawable as notification icon. But i am unable to do that. here is my code: Notification notification = new NotificationCompat.Builder(context) …
User42590
  • 2,473
  • 12
  • 44
  • 85
20
votes
3 answers

Android call method on notification click

This code creates a notification. If you click it, the current application is ran (the intent is created in Entry, which is my only Activity), a slightly modified version of a Android Developers blog: private void makeIntent() { …
stealthjong
  • 10,858
  • 13
  • 45
  • 84
19
votes
5 answers

How to create Multiple statusbar Notifications in android

I need to create multiple statusbar notifications. When i pull down the statusbar, multiple notification icons should be displayed as a list. Each notification icon should show separate data to display on next page.How could i do this? My…
sanjay
  • 2,590
  • 17
  • 55
  • 88
19
votes
3 answers

android.app.RemoteServiceException: Bad notification for startForeground

I'm trying to start foreground service as follow: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { NotificationChannel chan = new NotificationChannel( getApplicationContext().getPackageName(), "My Foreground…
19
votes
3 answers

Remove notification from notification bar from other applications

I want to remove notifications from another application shown in the notification bar. Is that possible? NotificationManager.cancelAll(); cancels only notifications shown by the calling application, as far as I know. Why do I want to do this? I have…
johboh
  • 1,003
  • 2
  • 9
  • 10
19
votes
1 answer

Android N notification title and icon color is darker

When showing a notification in android N and O it shows like this You can change the top color of the icon and the app name by using setColor method of the NotificationCompat.Builder, The problem is that the displayed color doesn't match the…
Ahmed Hegazy
  • 12,395
  • 5
  • 41
  • 64
19
votes
5 answers

android system notification limit per app

This may be off topic, but I couldn't found anything for it. Is there any limit on the number of notifications android app can display? I am facing issue after 100 notifications. There is no documentation which states this clearly. Note: This is not…
MohK
  • 1,873
  • 1
  • 18
  • 29
19
votes
3 answers

How to fix this bug : "android.app.RemoteServiceException: Bad notification posted from package"

The crash info is : android.app.RemoteServiceException: Bad notification posted from package com.xx.xx: Couldn't create icon: StatusBarIcon(pkg=com.xx.xx user=0 id=0x7f02035c level=0 visible=true num=0 ) …
user3879225
  • 191
  • 1
  • 1
  • 3
19
votes
2 answers

Android notfication BigPictureStyle disappearing text

I'm being implementing Android rich notifications using the compatibility library, so all my notifications are being built using android.support.v4.app.NotificationCompat.Builder the code I'm using is the following: // Base notification …
Budius
  • 39,391
  • 16
  • 102
  • 144
19
votes
3 answers

android notification in background if app closed?

I am trying to display a notification in the Android notifications bar even if my application is closed. I've tried searching, but I have had no luck finding help. An example of this is a news application. Even if the phone screen is off or the…
Noob
  • 2,857
  • 6
  • 33
  • 47