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

4666 questions
1
vote
1 answer

Notifications in Android 9 while the app is closed

How do you make notifications keep showing up while an app is closed? I have code kind of like this: DatabaseReference ref = database.child(username); ref.addValueEventListener(new ValueEventListener() { //some stuff here } Here, I give the user…
1
vote
0 answers

How to enable the "Show Notification as Pop Up" by default on android devices?

I am working on a food delivery app with Flutter. I have recently Implemented the flutter_local_notifications and the notification is working fine. But there's one problem is that the notification doesn't show as pop up by default. The "Show as pop…
1
vote
2 answers

Android foreground service multiple notifications for same service

I have a RecyclerView which has on each holder a start button to start a countdown timer, I start the countdown timer in a foreground service so that the user can leave the app or do whatever he wants and be aware of the timer, each time I start a…
1
vote
1 answer

How to Return to activity after the notification has appeared? Notification is not clickable

I have problem - it is not possible to return to the main activity after clicking on the received notification. The notification itself is not clickable. The notification is triggered in the onPause method (in the background) My main activity is…
1
vote
0 answers

How to detect whether app is opened through the push notification?

I was interested in how to detect if my application was opened from push notification created by the Android system. Because some push notifications are created by our implementation of FirebaseMessagingService, others are auto-created by the…
1
vote
1 answer

How can I create a notification channel for Android API level < 26 (before Android Oreo)?

I am currently working with an Android service: https://developer.android.com/guide/components/services I am creating a service that has to be a foreground service. But looking at the documentation, a foreground service requires a notification…
1
vote
1 answer

Why when I pressed notification, but PendingIntent didn't go to another Fragment?

Why when I pressed notification, but PendingIntent didn't go to DetailMessageRecyclerViewFragment?? I tried a lot but failed. MyFirebaseMessagingService.kt class MyFirebaseMessagingService : FirebaseMessagingService() { private var…
1
vote
0 answers

AlarmManager in Android 10 with Notifications

I am using AlarmManager in my project, since Android 10 doesn't allow startActivity in backround, for >Android 10 I start a forgroundservice. All works fine except I am not able to change notification sound, I want to set a custom sound or default…
1
vote
1 answer

No expand button in custom notification on Android 10

I'm trying to build expandable notification with two custom views Searching in internet says I need to use code like this val r = RemoteViews(activity.packageName, R.layout.cf_watcher_notification_small) val r2 = RemoteViews(activity.packageName,…
1
vote
0 answers

What does mean the "removeNotification for unknown key" warning from StatusBar on Android 8.1?

I have the following warning in my logcat on Oreo : W StatusBar: removeNotification for unknown key: 0|com.mycompany.myapp|666|null|10061 What does this warning mean ? What are the implications ? Should I worry about it or not ? Thank you in…
1
vote
1 answer

How to Make an Android Notification Expire in a specific time?

public class LayoutActivity extends AppCompatActivity { Button notifybtn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_layout); notifybtn=(Button)…
1
vote
2 answers

Android - On notification click open file and pressing back does not show app

I show a local notification after a file download complete String fileName = AppUtils.getFileNameFromUrlPath(download.getFile()); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext, channelId) …
1
vote
0 answers

getIntent() with Firestore Cloud Messaging not showing the Key Value Data

I've created an Android App that will have some daily news, and when any urgent news is published I will manually send a notification from FCM and when a user clicks on it, then the user will be redirected to my desired activity. Here is the code…
1
vote
0 answers

Android custom layout notification without white border

When I'm using NotificationCompat.DecoratedCustomViewStyle style with both big and usual custom content view, there are system notification UI for expand/collapse is visible: notification width is reduced to 320dp width in both modes, and 64dp…
wingear
  • 751
  • 7
  • 17
1
vote
0 answers

Grouped notifications fire the same pending intent

I am grouping multiple notifications into one group, each notification has a different pending intent. When any of the notifications in the group is clicked the same pending intent is fired (the one added to the last added notification). What I was…
Androidz
  • 384
  • 1
  • 5
  • 17
1 2 3
99
100