I have to delete an image in my application.
When I use File.delete
method (returns true, mean successfully deleted), file is deleted on file system, but it's visible in gallery. To delete it from gallery I use sending of ACTION_MEDIA_SCANNER_SCAN_FILE
intent or calling MediaScannerConnection.scanFile
.
After that the strange thing happens: deleted file resurrects and returns in File.listFiles
method.
How do I delete the file both from FileSystem and Gallery?