I'm making an app with a feature to allow images to be uploaded to the web server. After the captured image is uploaded to server, the image will be deleted from the user's device. I can upload the image and after I check the file manager, it is already removed. But somehow when I open the gallery, it's still there although it shows "unable to load file". But when I check details, it shows the size of the image. So how can I totally removed the uploaded image from the file manager & the gallery?
This is my code :
Public Static Boolean deleteDirectory(File path) {
// TODO Auto-generated method stub
if( path.exists() ) {
File files = path;
if(files.isDirectory()) {
deleteDirectory(files);
}
else {
files.delete();
}
}
return(path.delete());
}