'Batch delete after persisting uri chosen by user in ACTION_OPEN_DOCUMENT_TREE
I am moving from file API to SAF for Android 11+ devices only (I will continue using the file API for previous systems). I have learned that I can ask the user to select a folder/directory using SAF (ACTION_OPEN_DOCUMENT_TREE) then persist it so I no longer have to ask the user for access to the folder/directory he picked. Now, I am facing a design issue where I cannot use MediaStore.createDeleteRequest() for batch deletion on Android 11+ design. I need to be able to detect user allowing or cancelling deletion on MediaStore.createDeleteRequest() but it seems to be not possible to do. My question is. Is it possible to use the persisted uri to batch delete files within the persisted uri without asking the user for permission to delete each file one by one and thus bypassing the limitation of MediaStore.createDeleteRequest()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
