mercredi 4 novembre 2015

Android Gallery shows thumbnail even after file is deleted

In my app I am using DownloadManager to download video files from internet and store them in a directory (getExternalStorageDirectory()+"/myvideos").When file is downloaded it is shown automatically in Gallery app. When user select delete option in app for any video I delete file like this

File fd=new File(fileFullPath);
if (fd.exists()){
    fd.delete(); //this returns true and file is deleted

It is confirmed that file is deleted from storage because on traversing the root directory again the file is not present.

But the issue is that Gallery app still shows the thumbnail of video after it is deleted and when tap on that thumbnail it shows black screen with broken thumbnail in middle. I have tried several methods mentioned on stackoverflow and on other internet resources but none seems to work...thumbnail still shows

Aucun commentaire:

Enregistrer un commentaire