Skip to content Skip to sidebar Skip to footer

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

Filef=newFile(coverPath);

if(!f.exists()){

}

if not then I do this

publicvoidloadAlbumArtById(long id) {
    try {
        UrisongCover= Uri.parse("content://media/external/audio/albumart");
        UriuriSongCover= ContentUris.withAppendedId(songCover, id);
        ContentResolverres=this.context.getContentResolver();

        InputStreamin= 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"