Ich mache eine App basierend auf Benachrichtigung, in der ich Notification-Code implementiert hatte, aber in diesem Code möchte ich über Benachrichtigung Id. Was ist das kann jeder Körper erklären mich.Was ist Notification ID in Android
Code: -
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this);
mBuilder.setContentTitle("This is a notification");
mBuilder.setSmallIcon(R.drawable.app_me);
mBuilder.setContentText("You have successfully created notification");
Intent resultIntent = new Intent(this,ResultActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(ResultActivity.class);
stackBuilder.addNextIntent(resultIntent);
PendingIntent resultPending = stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(resultPending);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
// notificationID allows you to update the notification later on.
notificationManager.notify(notificationID, mBuilder.build());
und mein Code ausgeführt Erfolg voll – Satish
aber wenn ich auf Benachrichtigung klicken, wird es auf den Ergebnisbildschirm umgeleitet werden, aber Meldung erscheint immer noch in Statusleiste – Satish
Ihr Code wird ausgeführt.Wenn Sie die erstellte Benachrichtigung aktualisieren/entfernen müssen, benötigen Sie die NotificationID zu tun. –