1

My app posts notification while a document is uploaded and successfully uploaded. If post for multiple document uploads, it posts a series of app icons on the android notification bar.

private void updateNotification(String title, String fileId) {

    Log.v(TAG, "Updating notification for '" + fileId + "' with content: '" + title + "'");

    ApplicationSettings applicationSettings = new ApplicationSettings(mContext);

    NotificationManager notifyManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext);
    builder.setContentTitle(title)
            .setContentText(fileId)
            .setSubText(applicationSettings.getAccountEmail())
            .setSmallIcon(R.drawable.upload_notification);

    // Issue the notification
    notifyManager.notify(fileId.hashCode() /*notificationId*/, builder.build());
}

How do I group all my app notifications in android under a single notification icon?

I am looking for something like this:

enter image description here

enter image description here

Bertrand Martel
  • 42,756
  • 16
  • 135
  • 159
ssk
  • 9,045
  • 26
  • 96
  • 169
  • 1
    Possible duplicate of [How to group android notifications like whatsapp?](http://stackoverflow.com/questions/33040737/how-to-group-android-notifications-like-whatsapp) – Drew Szurko Feb 24 '17 at 23:18
  • Your screenshot is of notifications from the OS itself, and those are not subject to the same limitations as are Android SDK apps. On Android 6.0 and older devices, your only option is to raise a single `Notification`, updating as appropriate. Consider using an expanded style (e.g., `BigInboxStyle`). On Android 7.0+, you can use [bundled notifications](https://developer.android.com/about/versions/nougat/android-7.0.html#notification_enhancements). – CommonsWare Feb 24 '17 at 23:20

0 Answers0