我在这样的通知栏中显示通知。我得到了那些,但我不能在那里显示多个通知,一次只能显示一个。一个新的来了,前一个就走了。会有什么问题?
public void createNotificationRecever(Context context, String payload) {
Toast.makeText(context, commentor + "commented on your post " ,Toast.LENGTH_LONG).show();
//New message received
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.flag,
payload, System.currentTimeMillis());
// Hide the notification after its selected
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Intent intent = new Intent(context, MessageReceivedActivity.class);
intent.putExtra("id", groupid);
intent.putExtra("userid", text);
intent.putExtra("cname", groupname);
intent.putExtra("image", "");
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
intent, 0);
notification.setLatestEventInfo(context, "Message",
payload, pendingIntent);
notificationManager.notify(0, notification);
}}