How can I delete files using Storage Access Framework in Android? I found this method in the documentation, but could not get it to work: DocumentsContract.deleteDocument (ContentResolver, Uri);
Is it possible to delete a specific file without asking the user what to delete with this?
Edit:
I tried to get uri file with Uri.fromFile, with null pointer error. I tried to get the uri file using ACTION_OPEN_DOCUMENT, but it asks the user to select the file (I want to specify the file myself). Even as if it didn’t work, giving an exception and saying that I delete unsupported.
source
share