2

Knows that the permission of creating and deleting changes to SAF(storage access framework) in secondary storage SDCARD OS version after KitKat.

Under manifests, permission has been set,

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Version after KitKat By using new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE) Secondary storage SDCARD route will be chosen, converting DocumentUri set as takePersistableUriPermission()

For example, Version before KitKat.

File file = new File(path);
file.delete()

can be successfully deleted.

version after KitKat, delete() getting write permission error,

DocumentsContract.deleteDocument(getContentResolver(), Uri.fromFile(file)));

using deleteDocument() not found indicated with documented and unable to delete.

Is there any solutions for this issue? Is there any ways to find/change General mediated or filed to documented?

0 Answers0