You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can't get the permisson using storage.requestStorageAccess() for Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).
**override fun onRootPathPermissionGranted(requestCode: Int, root: DocumentFile) {
}**
The above callback, get path from root is /storage/home , uri : content://com.android.externalstorage.documents/tree/home%3A/document/home%3A. Obviously it was wrong.
The reuslt On Andorid 11
path: /storage/emulated/0/Documents
uri: content://com.android.externalstorage.documents/tree/primary%3ADocuments/document/primary%3ADocuments
The result on Android 11 was right.
The text was updated successfully, but these errors were encountered:
They both use URI to manage files. On SimpleStorage v1.3.0 and lower, you may notice that function DocumentFile.getAbsolutePath() for Documents folder returns /storage/home. I have added the compatibility for Documents folder. Now DocumentFile.getAbsolutePath() will return /storage/emulated/0/Documents whenever the URI is content://com.android.externalstorage.documents/tree/home%3A
You can use Documents folder with this home URI to manage files after SimpleStorage v1.4.0, which will be released soon. I have tested it and worked on OS 10:
Can't get the permisson using storage.requestStorageAccess() for Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).
**override fun onRootPathPermissionGranted(requestCode: Int, root: DocumentFile) {
}**
The above callback, get path from root is /storage/home , uri : content://com.android.externalstorage.documents/tree/home%3A/document/home%3A. Obviously it was wrong.
The reuslt On Andorid 11
path: /storage/emulated/0/Documents
uri: content://com.android.externalstorage.documents/tree/primary%3ADocuments/document/primary%3ADocuments
The result on Android 11 was right.
The text was updated successfully, but these errors were encountered: