我在這樣的通知欄上顯示通知。我正在那些,但我不能顯示多個通知,一次只有一個。當一個新的來臨,前一個去。問題是什麼?在收到gcm通知時顯示多個通知
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);
}}