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

Close notification from notification bar with a button without opening the app aga

public void addnotification() { NotificationCompat.Builder mbuilder = new NotificationCompat.Builder( this); Intent intent = new Intent(this, Main2Activity.class); PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, …
PIKakNIGHT
  • 41
  • 6
2
votes
0 answers

Minimize Downloads from Firebase

In my NotificationListener of my application I am listening (and syncronizing with my SQLite) to new or changed data from Firebase. In the first case I would like to check if the status of a loaned book has changed. Therefor I use the following code…
2
votes
2 answers

App opens automatically when receives broadcast

i have a big problem on my app. When it's closed (not in background) and it receives a broadcast the app is open and put on foreground. It's very annoying. I put the same broadcast receiver's code in an empty project and the problem doesn't…
2
votes
0 answers

Android notification gets cleared on opening App via app launcher

I have created a new application in which for showing notification used NotificationCompat Notify method. Defining a functionality that notification should get dismissed only on clicking it or swiping it. It should not get dismissed on opening app…
2
votes
1 answer

how to set Notification Button to Icon instead of words

This is my code so far on understanding notification. Intent mIntent = new Intent(this, typeof(MainActivity)); Intent gIntent = new Intent(this, typeof(GameMenu)); Intent sIntent = new Intent(this, typeof(SceneMenu)); …
jace
  • 1,634
  • 3
  • 14
  • 41
2
votes
1 answer

NotificationListenerService is not getting bound to SystemUI on Android 8 (Oreo)

Based on my testing, it appears that the NotificationListenerService(NLS) in my android app is not getting bound to the system on Android 8 (Oreo). I am targeting my app for SDK version 26 to make it compatible with the new OS. Prior to Android N,…
2
votes
2 answers

Execute the function only if the order status is changed

I am working on notification task. When an admin changed order status in admin panel, I would like to execute notification function. As of now, it is working for every 30 seconds. My main task is to execute notification function only if the order…
Jacky
  • 298
  • 3
  • 15
2
votes
1 answer

onTokenRefresh() is never called on first app install

I know there are a few other posts similar to mine but I've gone through the list of solutions with no results. My Android app has a very simple firebase implementation that is supposed to retrieve the token on startup and pass it via callback to…
deMouser
  • 369
  • 1
  • 2
  • 14
2
votes
1 answer

Xamarin.android Notification onClick doesn't take to new activity

This is going to be a long post! (grab a cup of coffee/popcorn) I am using AltBeacon Xamarin sample in my code to show the beacons. I have come across this example in creating Notifications in Xamarin. Here there's an Application class where the…
2
votes
1 answer

Push Notification it opens my first Activity instead of Activity defined in showNotification() method

I have a problem and maybe a lot of people happens, well when I try to start activity defined in showNotification method in MyFireBaseMessagingService Class Important: I config my aplication with shared preferences, IntroActivity(Splash) is showed…
2
votes
2 answers

How to retrieve the PendingIntent in the NotificationListenerService

I created a NotificationListenerService to play a sound once a I receive PUSH notification. But the NotificationListenerService informs me about any Notification occured system-wide, and what i am trying to do is, to restrict the behaviour of the…
2
votes
6 answers

Going back to main activity after launching activity from notification

I launch an activity from a notification I receive. If that notification is pressed it launches an activity. If there are no previous activities on the back-stack, or only a certain one, I want to remove that certain activity and insert my main…
x3lq
  • 93
  • 1
  • 15
2
votes
1 answer

How to show local notification every hour using service

I want to show local notification on every hour or particular seconds using service, I have tried to implement this functionality, but I didn't got success. My code is look like below AlarmManager alarmManager = (AlarmManager)…
Komal
  • 328
  • 3
  • 15
2
votes
1 answer

Heads up notification don't appear when notification arrives

I am trying to display notifications for an android app. The notification appears perfectly in the notification area but the heads up notification doesn't appear even after setting the priority to "max". Here is my code for notification…
maneesh
  • 216
  • 3
  • 14
2
votes
1 answer

Android local notification sometime won't show

I want to make local notifications that appears only 1st, 2nd and 3rd day of the month at for example 11am. I set up my notifications for 3 days in row at 12:30, 14:30 and 18:30 but it shown only once, at 14:30. When I checked android monitor for…
Gorthez
  • 391
  • 3
  • 12