"D/Notification: allPendingIntents" log while updating notification

Viewed 512

I'm updating a notification while progress is updating and each time I get a log which is not in my code:

D/Notification: allPendingIntents

Notification creation code :

mProgressNotifBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
    .setSmallIcon(R.drawable.ic_notification)
    .setPriority(Notification.PRIORITY_HIGH)
    .setContentTitle(notifTitle)
    .setAutoCancel(false)
    .setProgress(MAX_PROGRESS, 0, true)
    .setContentIntent(getPendingIntent());
setOfflineNotificationChannelId();
Notification notification = mProgressNotifBuilder.build();
startForeground(NOTIF_ID, notification);
mNotificationManager.notify(NOTIF_ID, notification);

Updating notification code:

private void updateNotificationProgress(int present) {
    mProgressNotifBuilder.setProgress(MAX_PROGRESS, present, false);
    mNotificationManager.notify(NOTIF_ID, mProgressNotifBuilder.build());
}

What does this log mean and how can I resolve it?

1 Answers

I hope I can help you, I've been having this problem recently, I think you need to add :

.setChannelId(NOTIFICATION_CHANNEL_ID)

in your code. also check out this link: https://developer.android.com/training/notify-user/channels and watch the video.

so your code should look like this;

mProgressNotifBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
    .setSmallIcon(R.drawable.ic_notification)
    .setPriority(Notification.PRIORITY_HIGH)
    .setContentTitle(notifTitle)
    .setAutoCancel(false)
    .setChannelId(NOTIFICATION_CHANNEL_ID)   // <---- add this  
    .setProgress(MAX_PROGRESS, 0, true)
    .setContentIntent(getPendingIntent());
setOfflineNotificationChannelId();
Notification notification = mProgressNotifBuilder.build();
startForeground(NOTIF_ID, notification);
mNotificationManager.notify(NOTIF_ID, notification);
Related