android-11

Unexpected behavior when DocumentFile.fromTreeUri() is called on Uri of subdirectory DocumentFile object

不想你离开。 提交于 2020-06-29 03:42:09
问题 If I call DocumentFile.fromTreeUri() on main directory and I list its content, it returns all DocumentFile object related to folders and files contained in the directory as expected, but when I try to call DocumentFile.fromTreeUri() on the Uri of one of the DocumentFile folders inside it, rather than returning all DocumentFile objects related to folders and files contained in the subdirectory as expected, it actually returns exactly the same content of the call on its root Uri E.g. I have a

Android 11 (R) file path access

谁说胖子不能爱 提交于 2020-03-01 09:56:29
问题 According to the docs file path access is granted in Android R: Starting in Android 11, apps that have the READ_EXTERNAL_STORAGE permission can read a device's media files using direct file paths and native libraries. This new capability allows your app to work more smoothly with third-party media libraries. The problem is that I can't get the file path from MediaStore , so how are we supposed to read a file path that we can't access/retrieve? Is there a way, I'm not aware of, that we can get