[英]Do I have to check READ_EXTERNAL_STORAGE before checking if folder exists or listing its subfolders
I know that READ_EXTERNAL_STORAGE is needed to read files outside app storage, but how about folders.我知道读取应用程序存储之外的文件需要 READ_EXTERNAL_STORAGE ,但是文件夹怎么样。 The official documentation ( https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE ) isn't very clear and other sources online are not helpful either.官方文档( https://developer.android.com/reference/android/Manifest.permission#READ_EXTERNAL_STORAGE )不是很清楚,其他在线资源也没有帮助。 Do I have to check this permission before I check if some specific folder exists and what subfolders does it have?在检查某些特定文件夹是否存在以及它有哪些子文件夹之前,我是否必须检查此权限?
As @blackapps suggested, checking if any folder exists works always without permission on API 23 device.正如@blackapps 所建议的那样,在 API 23 设备上检查是否存在任何文件夹总是无需许可。 Listing contents (subfolders) is more complicated:列出内容(子文件夹)更复杂:
Still I'd like to know more universal answer.我仍然想知道更普遍的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.