我使用的是 Marshmallow(api 23) 操作系统。
我已经声明了相关权限并在运行时请求这些权限。我通过 Environment.getExternalStorageDirectory()
获得了外部存储目录——"/storage/emulated/0"。使用这个文件实例(我将其称为 extF
),extF.listFiles()
不为 null。但是,extF.getParentFile().listFiles()
返回 null。
在 adb shell 中,我检查了 "/storage/emulated"
目录,发现有两个子目录:
0
obb
那么,在 Marshmallow(api23)
上为什么无法通过 File.listFiles()
获取 "/storage/emulated"
的子文件呢?谢谢您的解释。