0
我的問題是如何合併多個通知? 這裏是我的代碼:如何合併多個推送通知?
private void sendNotification(String msg) {
mNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, DemoActivity.class), 0);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this)
.setSmallIcon(R.drawable.ic_stat_gcm)
.setContentTitle("GCM Notification")
.setStyle(new NotificationCompat.BigTextStyle().bigText(result))
.setContentText(result);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(++NOTIFICATION_ID, mBuilder.build());
}
它給了我喜歡的Windows Phone每一個人的通知,但我不能合併成一個通知。所以,請給我建議在這個方法中實現什麼。
mNotificationManager.notify(NOTIFICATION_ID,mBuilder.build()); ...試試這個.. – 2014-10-11 07:41:13
Thnks for this ... but it overwrite the message but I want like .....「2 message」 – 2014-10-11 08:05:42
Do你的意思就像在whatsapp?即來自用戶的2條消息? – berserk 2014-10-11 08:51:47