小编Hai*_*eon的帖子

使用存储访问框架打开特定目录

我现在可以通过使用以下代码打开Lollipop文件选择器来获取文件URI:

            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_OPEN_DOCUMENT_TREE);
            startActivity(intent);
Run Code Online (Sandbox Code Playgroud)

文件选择器在内部存储的根目录或我打开的最后一个目录中打开.如何让文件选择器显示特定目录的内容?例如,我可能希望文件选择器在启动后显示Download文件夹的内容,如下图所示.

打开的子目录

android android-intent storage-access-framework android-5.0-lollipop

9
推荐指数
1
解决办法
1145
查看次数