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
15
votes
2 answers

Android 10 Incoming call notification like whats app when we are in another app

Once we received FCM push notification message in android 10 background start activities restricted. Need a solution like WhatsApp and Skype notification incoming call when we are in another app. int NOTIFICATIONID = 1234; // Uri sound = …
15
votes
3 answers

Send argument through PendingIntent of NavDeepLinkBuilder

I'm having some difficulties sending an argument through a PendingIntent of a notification using NavDeepLinkBuilder. I'm able to get the destination Activity to launch by clicking the notification, but the Activity's Intent doesn't contain the…
15
votes
1 answer

What differences between NotificationManager and NotificationManagerCompat?

I am able to create notification so: NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (notificationManager != null) { notificationManager.notify(NOTIFICATION_ID,…
user9545467
15
votes
5 answers

Resume an activity when clicked on a notification

I've made an app which manage sms, I've created the notifications but when I click on them it starts another activity, I would like to know how to check if an activity has been stopped and resume it. Here is the code used to create the…
codareee
  • 570
  • 2
  • 8
  • 19
15
votes
4 answers

Why does the "download completed" notification disappear on Gingerbread devices?

I'm using the DownloadManager class to programatically download a file. All works fine but I can't get the download completed notifcation to persist. It disappears immediately once the download has completed. Here's my code: Request rqtRequest = new…
14
votes
2 answers

How to add android notification channel id for flutter app to fix notification while app is on background

In my flutter app the function onResume and onLunch not working on android platform, while they work fine on IOS, i receive the following message on console instead of printed strings in those functions: "W/FirebaseMessaging(24847): Missing Default…
14
votes
1 answer

How to get Override Do not Disturb Settings Value?

How do I get Override Do Not Disturb Settings state in Android for my own package app?
NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74
14
votes
2 answers

What are AllowedDataTypes on RemoteInput?

There's a new function called setAllowDataType on RemoteInput.Builder in API 26. What is this used for? I tried the following: val remoteInput = RemoteInput.Builder(KEY_TEXT_REPLY) .setLabel("Image") …
Jason
  • 13,563
  • 15
  • 74
  • 125
14
votes
2 answers

Bad Notification: Couldn't expand RemoteViews for: StatusBarNotification. on Android Nougat

I use OneSignal SDK to show notifications. I do it in OneSignalPushService.java. OneSignalPushService.java: public class OneSignalPushService extends NotificationExtenderService { @Override protected boolean…
14
votes
3 answers

How to show a notification everyday at a certain time even when the app is closed?

Although this question might have been asked before on Stack Overflow, I still haven't found a clear answer. I want to show a notification everyday at 12pm for example even when the app is closed. I have referenced from those links: Notifications in…
14
votes
4 answers

How to get text of Stacked Notifications in Android

The question is how to get the TEXT (not title) field of all incoming notifications when they get stacked (like in Whatsapp). public class NLService extends NotificationListenerService { public void onNotificationPosted(StatusBarNotification sbn)…
user1406716
  • 9,565
  • 22
  • 96
  • 151
14
votes
4 answers

Make Notification Large Icon Round

I want to display a circular avatar from the user's contacts as the large icon of the notification - like when receiving a text or mail. When I set the large icon as that contact's image, it results in a square icon. I'm looking to turn something…
Itai Hanski
  • 8,540
  • 5
  • 45
  • 65
14
votes
3 answers

Parse.com - Android custom push notification sound

I know that push notification sound, in Android, can be customised (on iOS already working). However, I don't see any reference in the docs, only per iOS custom sound. I saw in Parse.com forum that such a feature was requested about a year ago and…
14
votes
4 answers

Protocol used for sending push notification in Android

I want to know which protocol is used to send push notification to android devices and which to send push notification requests to GCM. Whether it is HTTP, HTTPS or some thing else?
14
votes
5 answers

Android: Manage multiple push notification in device of an app

I am developing an application in which i implemented Push notification functionality. My code of onMessage - GCMIntentService.java is: @Override protected void onMessage(Context context, Intent data) { String message =…