There was a problem with an attempt to delete an image from the /storage/<code>/DCIM/Camera directory, which is the internal storage of the gallery on the device.

  • With Android N, the secondary sd card is in read-only mode, which now makes it impossible to use the File.delete() call to delete arbitrary files.

  • ContentResolver.delete() does not delete the file itself, which on subsequent scanning of the media will result in the file being returned back to the gallery.

  • There is a need to delete files without unnecessary gestures from the user, for which the Storage Access Framework (SAF) is not suitable.

Applications like Total Commander can do this, so the question is, is it possible to achieve this goal on the latest versions of Android (Api> = 25)?

    0