3
mediaSessionCompat.setMetadata(new MediaMetadataCompat.Builder()
                            .putString(MediaMetadataCompat.METADATA_KEY_ALBUM, trackDataNowPlaying.JukeBoxCategoryName)
                            .putString(MediaMetadataCompat.METADATA_KEY_TITLE, trackDataNowPlaying.TrackName)
                            .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, Math.round(trackDataNowPlaying.Length))
                            .putBitmap(MediaMetadataCompat.METADATA_KEY_ART, resource)
                            .build());

Putting bitmap on MediaSessionCompat not showing ART WORK in lockscreen. Above code used when on track changed.

Bincy Baby
  • 3,941
  • 5
  • 36
  • 62

1 Answers1

1

As far as I know the way to achieve that is through setting the Large Icon when building your notification with setLargeIcon

You can also use the NotificationCompat.MediaStyle and define the player icons and actions you desire for the user to interact with there. Apply this style to the notification with setStyle

pantos27
  • 629
  • 4
  • 13
  • bro used the all things you mentioned above but it is not work for me check this https://stackoverflow.com/questions/54742921/why-mediasession-not-changing-the-lock-screen-background-may-be-bitmap-size-pro – Vipul Chauhan Feb 18 '19 at 10:47