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

Update notification to remove chronometer (KitKat)

I need to show a notification and update it over the course of its lifetime. In particular, I need to change certain flags, such as "show chronometer". For that, the documentation states that we should call NotificationManager.notify() with the same…
matiash
  • 54,791
  • 16
  • 125
  • 154
2
votes
1 answer

PUSH-notification duplicated with empty content

Dispatched test push into my device. When the application is active, push comes normally with sound, but when the app is minimized, comes 2 empty pushes and without sound. Even if onMessageReceived left empty, still displays two empty…
zayn1991
  • 174
  • 10
2
votes
2 answers

Android - Play/Pause Update RemoteViews in Notification

I'm trying to implement play/pause button in notification via frame layout but when I click to pause the mediaPlayer it doesn't updates to show the play button in the notification.How to update the view? RemoteViews nv = new…
zek54
  • 415
  • 3
  • 20
2
votes
1 answer

How to open my application in current state from notification

I need to open app in current state, without any new instance of my main Acitivity Here is my code Intent intent = new Intent(baseActivity, MainActivity.class); intent.putExtra("FROM_NOTIFICATION", true); …
kadik
  • 149
  • 1
  • 11
2
votes
3 answers

Calculate session length android

How can I calculate session length of a user in android so that I can push ads at the right time? Is there a library that can help me with this. I am using google analytics to get average session length but how do I get that of individual users?
Blaze Mathew
  • 185
  • 9
2
votes
1 answer

Android Notification with BigPicture style and BigText style

Does anyone can help me out here.How to implement BigPictureStyle notification with multiline summary text in android.I am able to do by reducing text size which I don't want to.Please help me out on this. Can we combine two types of notification…
2
votes
2 answers

Notification not working on API 23

my notification is not working on API 23. My Notfication works succesfull from API 16 to 22 The 100 for calstd/calmin is a default number. if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) { …
2
votes
0 answers

NotificationCompat not showing up properly in Android

I would like to show a notification similar to: So I tried the following code: NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext); builder.setSmallIcon(R.drawable.ic_launcher); Intent intent =…
Sanjana Nair
  • 2,663
  • 6
  • 26
  • 44
2
votes
1 answer

Notification android show date

On the right side of notification android is showing time. It is possible to show both, date and time as I didn't found any notification api to set the date. Or it is android behaviour to show only time?
Amad Yus
  • 2,856
  • 1
  • 24
  • 32
2
votes
2 answers

Android Notification custom sound not working

I've searched the web and found some post related to setting sound on android notification and followed them but in my case I am getting default notification sound on android notification. Here's my…
Mostafa Imran
  • 659
  • 2
  • 9
  • 28
2
votes
1 answer

Can the heads-up notification height be increased to 256dp?

I see that setting bigContentView increases the notification height to 256dp but this applies to only notification in expanded form. Can the heads-up notification itself be made of the size of bigContentView? Using headsUpContentView only increases…
2
votes
2 answers

Click event not working on Heads-up notification

Nothing happens on clicking Accept or Reject button of the head-ups notification. But when the head-up notification disappear and from clicking Accept and Reject from the notification panel is working. Testing on Android 5.1.0. Intent acceptIntent…
Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85
2
votes
3 answers

How to send a notification with sound and vibration in do not disturb(DND) mode in android

How can I send a notification with sound and vibration when phone is in do not disturb mode on Android Devices. I use the following code, and it is working when my application is currently in foreground. PendingIntent contentIntent =…
Arvind
  • 75
  • 10
2
votes
1 answer

Notification click in Android(Xamarin Forms)

I used Xamarin Form. I have an application with notifications that open a certain activity if I click them. I want that, if I click the notification and the activity is already opened, it's not started again, but just brought to front. It is my code…
2
votes
1 answer

Notification Not Being Updated

I'm trying to update a notification, But I'm not able to do it, Here's my code : NotificationCompat.Builder nBuilder; RemoteViews remoteView; static NotificationManager nManager; static int NOFIY_ID = 2; static Bitmap bitmap2; static boolean…
Jaeger
  • 1,646
  • 8
  • 27
  • 59