In the Android Universal Music Player, there is an icon which is displayed for a list. However, that icon is not shown. The original source code, set the icon as follow:
if (MEDIA_ID_ROOT.equals(parentMediaId)) {
LogHelper.d(TAG, "OnLoadChildren.ROOT");
mediaItems.add(new MediaBrowser.MediaItem(
new MediaDescription.Builder()
.setMediaId(MEDIA_ID_MUSICS_BY_GENRE)
.setTitle(getString(R.string.browse_genres))
.setIconUri(Uri.parse("android.resource://" +
"com.example.android.uamp/drawable/ic_by_genre"))
.setSubtitle(getString(R.string.browse_genre_subtitle))
.build(), MediaBrowser.MediaItem.FLAG_BROWSABLE
));
}
I thought there might be issue with the way the uri is handled, so I changed it to the following:
.setIconUri(Uri.parse("android.resource://" +
getPackageName() + "/" + R.drawable.ic_by_genre))
The icon exist in the resource file, however it is not displayed and instead of icon it is simply blank.
Did anybody face similar issue when they tried this sample project? and how to fix it?