2014-12-10 49 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

火通知更新您的通知ID讀[文檔](http://developer.android.com/reference/ android/app/NotificationManager.html)關於notify(int,Notification) - int id是重要的 – panini 2014-12-10 23:14:28

回答

1

你需要,當你在

notificationManager.notify(ID, notification); 
+0

Thaks!工作正常 – Luis 2014-12-11 15:53:00