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
This works for me:
Java
File file = new File(photoPath);
file.delete();
MediaScannerConnection.scanFile(context,
new String[]{file.toString()},
new String[]{file.getName()},null);
Kotlin
val file = File(photoPath)
file.delete()
MediaScannerConnection.scanFile(context, arrayOf(file.toString()),
arrayOf(file.getName()), null)