Not able to show Icons using setIconBitmap

81 views
Skip to first unread message

Aditya Chauhan

unread,
Jul 30, 2021, 12:29:26 PM7/30/21
to Android Automotive OS Discussion Group
I am trying to show a browsable list in the android automotive media application.
Inside MediaBrowserService, I tried :

mediaItems.add(new MediaBrowserCompat.MediaItem(
new MediaDescriptionCompat.Builder()
.setMediaId(my_id)
.setTitle("my_title")
.setIconBitmap(BitmapFactory.decodeResource(getResources(),
                             R.drawable.ic_myIcon))
.build(), MediaBrowserCompat.MediaItem.FLAG_BROWSABLE));

I also tried below :

mediaItems.add(new MediaBrowserCompat.MediaItem(
new MediaDescriptionCompat.Builder()
.setMediaId( my_id  )
.setTitle("my_title")
.setIconUri(my_uri)
.build(), MediaBrowserCompat.MediaItem.FLAG_BROWSABLE));

But I am not able to see my icon in the list. Can anyone help me out please?
Reply all
Reply to author
Forward
0 new messages