From here: https://stackoverflow.com/a/70933975/13519865
if I,
private val dirRequest = registerForActivityResult(ActivityResultContracts.OpenDocumentTree()) { uri ->
if (uri != null) {
DocumentsContract.getDocumentId(uri)
}
}
I get
java.lang.IllegalArgumentException: Invalid URI: content://com.android.externalstorage.documents/tree/9C33-6BBD%3AA
at android.provider.DocumentsContract.getDocumentId(DocumentsContract.java:1278)
I need documentId for,
DocumentsContract.buildChildDocumentsUriUsingTree(rootUri, documentId)