2014-12-10 2 views
0

Здравствуйте, у меня есть система для уведомления, эта работа прекрасна, но если две или несколько уведомлений отправляют первое уведомление в центр уведомлений, как мне сделать, чтобы отобразить два уведомления? У меня есть пример для notfication:Уведомление Android исчезает вместо добавления в диспетчер уведомлений?

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); 
+0

читать [документы] (http://developer.android.com/reference/ android/app/NotificationManager.html) об уведомлении (int, Notification) - значение int id важно – panini

ответ

1

Вам необходимо обновить ID уведомления, когда вы стреляете Уведомление в

notificationManager.notify(ID, notification); 
+0

Thaks! отлично работать – Luis

Смежные вопросы