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
1 answer

android.app.PendingIntent cannot be accessed ouside the package

I'm trying to make notification, but it keeps telling me that PendingIntent in android.app.PendingIntent is not public it cannot be accessed outside the package this is the full method: final Runnable m_Runnable = new Runnable() { public void…
2
votes
1 answer

Android Notification Multiple Defaults

Below is the code I am using to send a notification to the user: NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.ic_notification) .setContentTitle("Secure…
Toby Clench
  • 403
  • 1
  • 5
  • 22
2
votes
1 answer

Exact time for custom notifications in Android

I am developing an Android application for counseling services. Client can view their scheduled appointment in app. For example, Next appointment: Dec 31 2016 10:00AM Now I need to do that user will receive 2 notifications – reminders about…
2
votes
0 answers

Notifications with sensitivity to the NotificationManager.Policy settings

Android developers. I need your help.It's for api>=23 with turn on "Do not dsturb". I need to create notifications with sensitivity to the NotificationManager.Policy settings, but can't find a way. We cant value without allowed permission…
Max Bykov
  • 53
  • 7
2
votes
0 answers

How to count Notification of Any application

Hello i make one example which show count of notification which user got, with help of NotificationListenerService what i actually implemented yet... public void onNotificationPosted(StatusBarNotification sbn) { final String pkgnm =…
Bhanu Sharma
  • 5,135
  • 2
  • 24
  • 49
2
votes
4 answers

How to prevent notification bar from closing upon notification action click

In my app i have notification with pause/play action, however, when user clicks on the action, notification bar is closing. How can i prevent notification bar from closing upon action click? Method which creates notifcation: public void…
Michał Witanowski
  • 602
  • 3
  • 8
  • 22
2
votes
5 answers

Android Firebase notifications (FCM)

I am using FCM in my app. I followed the Firebase documentation and all seems to be working as expected. I am able to receive message notifications when the app is killed, in background and in foreground. Now I want to give full control the user by…
2
votes
1 answer

onGoing notification can still be removed by user, manually

i create an application and i want after click on specific button, a "Permanent Nofitication" show on notification bar. i search for it and use these codes: NotificationCompat.Builder builder = new NotificationCompat.Builder(this) …
linarcx
  • 116
  • 3
  • 17
2
votes
1 answer

Set onClickListener on action buttons of Notification

I'm delivering a Notification to the user which has two action buttons "Accept" and "Reject". As soon as a user clicks "Accept", I want to check few conditions and then proceed accordingly. I don't want the user to just navigate to the screen which…
2
votes
0 answers

Alarm Manager + Notification actions

I am trying to create a notification with two actions - Dismiss and Snooze but the first action is never called. I am trying the notification the following way: NotificationCompat.Builder builder = (NotificationCompat.Builder) new…
user3637775
  • 499
  • 4
  • 20
2
votes
1 answer

Issue loading resources when app is not running

I've found similar problems regarding small icons on android notifications, but Google won't give me any hints to following issue: Simply and short, my notifications won't show color and icon when the app is not opened, but it'll work perfectly…
2
votes
1 answer

NotificationCompat.Builder with expand notification is not working

I am trying to expand notification if text is long by below code. NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(getNotificationIcon()) …
Anant Shah
  • 3,744
  • 1
  • 35
  • 48
2
votes
1 answer

How to get Firebase notification status (opened or not) which is sent from PHP backend?

When I send any notification from Firebase console, I can monitor my notification status (how many device received or how many opened it) from Firebase console. Now I developed a PHP backend and using curl I can send notification to my users. I need…
2
votes
2 answers

White notification icon on Android Marshmallow

Since I am using card view my minimim sdk is for adroid Lollipop and I know from Lollipop you have to use transparent icon for notification bar I have created a transparent notification icon (32x32) and stored it in drawable But whenever I am…
Nawaz
  • 63
  • 1
  • 2
  • 9
2
votes
1 answer

Android: Firebase - multiple senders pushing notifications to specific devices

I am working on an android app that will be used by students to register at schools. I want the different school offices to be able to send push notifications to specific students. I implemented the firebase example and were able to send a push…