Android Image Files Deleted From Com.android.providers.media/albumthumbs On Reboot
My app is using images from folder /storage/emulated/0/Android/data/com.android.providers.media/albumthumbs. When I change language and restart phone it is deleting image files fro
Solution 1:
Maybe too late but I had the same problem in my app. A workaround which works for me is following
Firstly I load vie media store all album arts. So I can get some file paths but there is no files therefore for begin I check whether file exists
File f = new File(coverPath);
if(!f.exists()){
}
if not then I do this
public void loadAlbumArtById(long id) {
try {
Uri songCover = Uri.parse("content://media/external/audio/albumart");
Uri uriSongCover = ContentUris.withAppendedId(songCover, id);
ContentResolver res = this.context.getContentResolver();
InputStream in = res.openInputStream(uriSongCover);
} catch (Exception ex) {
// do something
}
}
Where Id is album id from media store (MediaStore.Audio.Albums._ID) After I run this function, art is available again, I don't know why, but it works for me
Post a Comment for "Android Image Files Deleted From Com.android.providers.media/albumthumbs On Reboot"