public Bitmap getAlbumart(Long album_id)
{
Bitmap bm = null;
try
{
final Uri sArtworkUri = Uri
.parse("content://media/external/audio/albumart");
Uri uri = ContentUris.withAppendedId(sArtworkUri, album_id);
ParcelFileDescriptor pfd = context.getContentResolver()
.openFileDescriptor(uri, "r"); //Error
if (pfd != null)
{
FileDescriptor fd = pfd.getFileDescriptor();
bm = BitmapFactory.decodeFileDescriptor(fd);
}
} catch (Exception e) {
}
return bm;
}
Asked
Active
Viewed 82 times
0

Politank-Z
- 3,653
- 3
- 24
- 28

shaiban
- 331
- 5
- 12
-
What's the error? Please include the logcat if it's relevant. – Buddy Jun 16 '15 at 20:13
-
After reading the..ParcelFileDescriptor pfd = context.getContentResolver() .openFileDescriptor(uri, "r");...Control jumps to exception everytime.. – shaiban Jun 17 '15 at 02:26
-
What's the exception? – Buddy Jun 17 '15 at 04:11
-
I found out the solution using Picasso library to display the album. thank you. – shaiban Aug 24 '15 at 11:37