Luis
Luis

Reputation: 545

Android Notification disappears instead of adding in notification manager?

Hello I have system for notification, this work fine,but if two or more notifications send the first notification disappear to notification center, How do I can do to make the two notifications are displayed? i have example for notfication:

Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
                            Notification n  = new Notification.Builder(context)
                                    .setContentTitle("Redar App")
                                    .setContentText("Welcome to:  "+ restaurant_name)
                                    .setSmallIcon(R.drawable.ic_launcher)
                                    .setContentIntent(pIntent)
                                    .setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
                                    .setAutoCancel(true)
                                    .setSound(alarmSound).build();
                            n.tickerText = "Redar Beacons ";
                            n.when = System.currentTimeMillis();
                            NotificationManager notificationManager =
                                    (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

                            notificationManager.notify(0, n);

Upvotes: 0

Views: 141

Answers (1)

Ajay Takur
Ajay Takur

Reputation: 6236

You need to update your Notification ID when you fire a Notification in

notificationManager.notify(ID, notification);   

Upvotes: 1

Related Questions