I'm making a music player application but I dont know how to show the album
art or the cover art of the song as it plays. I'm thinking of fetching it
in the java file and showing it into the xml file. Anybody can help?
I've tried something like this but it doesnt work:
View view = null;@SuppressWarnings("null")String coverPath =
songsList.get(songIndex).get(MediaStore.Audio.Albums.ALBUM_ART);Drawable img =
Drawable.createFromPath(coverPath);@SuppressWarnings("null")ImageView
coverAlbum=(ImageView)view.findViewById(R.id.songThumbnail);
coverAlbum.setImageDrawable(img);
Here's the xml for the album art:
<LinearLayout
android:id="@+id/songThumbnail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:gravity="center"
android:layout_below="@id/player_header_bg">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/default" />
</LinearLayout>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en