I\'m trying to delete images stored in internal storage. I\'ve come up with this so far:
File dir = getFilesDir();
File file = new File(dir, id+\".jpg\");
bo
File file = new File(getFilePath(imageUri.getValue()));
boolean b = file.delete();
is not working in my case.
boolean b = file.delete(); // returns false
boolean b = file.getAbsolutePath.delete(); // returns false
always returns false.
The issue has been resolved by using the code below:
ContentResolver contentResolver = getContentResolver();
contentResolver.delete(uriDelete, null, null);