如何显示特定歌曲的专辑封面?
How to display the album art for a particular song?
我正在创建一个音乐播放器,但现在我无法显示特定歌曲的专辑封面。
请帮帮我
Use this code to get the album art for particular song.
ContentResolver res = getContentResolver();
Uri smusicUri = android.provider.MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Cursor music =res.query(smusicUri,null,null, null, null);
music.moveToFirst();
int x=music.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART);
String albumArt = music.getString(x);
Bitmap bm= BitmapFactory.decodeFile(albumArt);
ImageView image=(ImageView)findViewById(R.id.IValbumArt);
我正在创建一个音乐播放器,但现在我无法显示特定歌曲的专辑封面。
请帮帮我
Use this code to get the album art for particular song.
ContentResolver res = getContentResolver();
Uri smusicUri = android.provider.MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI;
Cursor music =res.query(smusicUri,null,null, null, null);
music.moveToFirst();
int x=music.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART);
String albumArt = music.getString(x);
Bitmap bm= BitmapFactory.decodeFile(albumArt);
ImageView image=(ImageView)findViewById(R.id.IValbumArt);