-3

I'm creating a music player and now I am stuck on displaying the album art for particular songs.

Please help me.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Pedo
  • 194
  • 1
  • 2
  • 14

1 Answers1

1

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);
Hiren Jungi
  • 854
  • 8
  • 20