the fastest way
```
Glide.with(imageView.getContext())
.load(getSongCover(file.getPath()))
.placeholder(R.drawable.audio_placeholder)
.error(R.drawable.audio_placeholder)
.dontAnimate()
.into(imageView);
public byte[] getSongCover(String path) {
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(path);
return mmr.getEmbeddedPicture();
}
```
add it to your build.gradle
```
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
```
works great inside recyclerview, listview etc.
I dit it like this...
```
Glide.with(imageView.getContext())
.load(getSongCover(file.getPath()))
.placeholder(R.drawable.audio_placeholder)
.error(R.drawable.audio_placeholder)
.dontAnimate()
.into(imageView);
public byte[] getSongCover(String path) {
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
mmr.setDataSource(path);
return mmr.getEmbeddedPicture();
}
```
add it to your build.gradle
```
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
```
works great inside recyclerview, listview etc.