0
私はこのサービスから通知を送信するメッセージを受信するたびにサーバからの受信メッセージを処理するサービスを持っていますが、残念ながら以前の通知は通知バーの新しい通知によって上書きされます。 これを修正する方法はありますか?これは私のコードです:送信通知はandroidの以前の通知を上書きします
異なる通知のために異なるIDを設定NotificationManager notificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
Intent intent = new Intent(DbInsertService.this, MessageActivity.class);
intent.putExtra("Service",serviceType);
PendingIntent pIntent = PendingIntent.getActivity(DbInsertService.this, (int)
System.currentTimeMillis(), intent,PendingIntent.FLAG_UPDATE_CURRENT);
Notification n = new Notification.Builder(DbInsertService.this)
.setContentTitle("Message from " +serviceType.getSer_name())
.setContentText(messageType.getHis_title())
.setSmallIcon(R.drawable.ic_email_variant_grey600_24dp)
.setContentIntent(pIntent)
.setAutoCancel(true).build();
notificationManager.notify(0, n);
thansk
すばやく正確な返信をいただきありがとうございます – Programmer