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

How to send Notification through Firebase console including Custom data?

I have to send a URL in notification and I want upon clicking the notification, the link will be opened immediately by Chrome. Currently, when I click the notification, it only opens my app. What changes do I have to implement in this code for my…
2
votes
3 answers

How to cancel retrofit 2 request when notification action is clicked?

In my app, I am doing multiple upload requests using retrofit 2 and launching a new notification for each upload. After going through a lot of similar questions, I am not sure how can I cancel the request using Call.cancel for a particular upload…
Sam Berg
  • 189
  • 3
  • 11
2
votes
1 answer

Adding gif to Android Expanded Push Notification in Android N

I currently use BigPictureStyle in order to add pictures to expanded notifications in Android. Is it possible to add a gif to an expanded notification preview? Thank you
Daniel
  • 21
  • 3
2
votes
2 answers

ScaleType cropCenter not working on custom Notification layout - Android 4.x

I create a custom (big) notification with the following layout:
fweigl
  • 21,278
  • 20
  • 114
  • 205
2
votes
1 answer

FirebaseMessagingService not called after second background

I try to use Firebase for push notifications for Android. But I faced very strange issue. All is OK when I send push in foreground. All is OK when I send push in background (I sending only data), until I come back to foreground and then back to…
2
votes
1 answer

How to get default color and style of action buttons in notifications?

I need to create a custom layout for my notification, with android's native look and feel. I've used these resources for title and…
h.nodehi
  • 1,036
  • 1
  • 17
  • 32
2
votes
0 answers

Weird white expansion in android notification setContent

Trying to implement a custom notification, but I am getting this awful expansion to the notification when i try to forcefully expand it (In my case was not expecting it). This only happens when i switch off screen and then try to interact with the…
2
votes
1 answer

Push Notification with action button is not working

i have used the fcm for notification and its coming correctly, but when i try to add add buttons in notification its not showing. my code Intent intent = new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); …
2
votes
1 answer

How to use startForeground with NotificationCompat.Builder?

NotificationCompat.Builder builder = new NotificationCompat.Builder(context); builder.setContentTitle(description.getTitle()) .setAutoCancel(false); NotificationManager notificationManager=(NotificationManager)…
Bincy Baby
  • 3,941
  • 5
  • 36
  • 62
2
votes
2 answers

Android: Cannot open downloaded file from notification. Error: "Can't open file"

My app downloads a file from the internet and saves it into "Downloads" folder as well as providing a notification, that file has been downloaded. When I click the notification, I have created chooserIntent to select an app to open the file.…
2
votes
1 answer

On notification button click intent starting new activity instead of resuming

I am trying to implement a custom notification for my mediaplayer with notification bar that has just one button that will act as stop and play control. So far have implemented the notification successfully and the button is making the function…
2
votes
2 answers

Group notifications on Android

I want to show notifications like on picture. If there is more than one, I want to show a counter too. I didn't find info in official doc. Now I just update my notification by id: ((NotificationManager)…
2
votes
0 answers

Notifcation Android from Service Firebase can update and not open the pending Intent

I have problem with my notification. In my app, I use Firebase. I call notification every get message. But I have problem: Notification does not update Title and Content Text. Pending Intent does not open the target Activity This my Notification…
2
votes
1 answer

Broadcast by Notification Action not handled in BroadcastReceiver inside Service

I am trying to build a notification while a music playback service is running and use the notification to interact with the service (play, pause, stop) using the Broadcast mechanism. (I know there is also the possibility to use…
2
votes
1 answer

Repeat notification every day 12h

I want repeat my notification every day at 12h, but my code isn't working... I launch my Alarm Manager in MainActivity in OnCreate like this : protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
Max Vé
  • 49
  • 1
  • 4