Search code examples
androidandroid-notificationsandroid-developer-api

Large icon never shows in MessagingStyle notification


For some reason the large icon does not show up in a MessagingStyle notification. The Android developer documentation does not make any exclusion regarding this behavior, the only requirement is for the MessageStyle to have the setGroupConversation set to true in order to show the large icon.

Example below directly from official documentation:

 Person user = new Person.Builder().setIcon(userIcon).setName(userName).build();

 MessagingStyle style = new MessagingStyle(user)
      .addMessage(messages[1].getText(), messages[1].getTime(), messages[1].getPerson())
      .addMessage(messages[2].getText(), messages[2].getTime(), messages[2].getPerson())
      .setGroupConversation(hasMultiplePeople());

 Notification noti = new Notification.Builder()
     .setContentTitle("2 new messages with " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_message)
     .setLargeIcon(aBitmap)
     .setStyle(style)
     .build();

Is this a bug or is it being done incorrectly or has this been changed and never documented?

As it stands the large icon never shows up for notifications containing multiple users.

NOTE: I am not referring to the user's avatars/images (this is set in the Person builder as an icon), but an icon that shows for the notification itself, they are different things.


Solution

  • Looks like this is per design, even though it is not documented anywhere.