附加以启用带有存储访问框架(SAF)的显示/隐藏SD卡 [英] Extra to enable the Show/Hide SD Card with Storage Access Framework (SAF)

查看:193
本文介绍了附加以启用带有存储访问框架(SAF)的显示/隐藏SD卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用存储访问框架(SAF):

I am using the Storage Access Framework (SAF) :

Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.addCategory(Intent.CATEGORY_OPENABLE);
intent.setType("image/*");
startActivityForResult(intent, 0);

我想知道是否还有其他功能可以启用显示SD卡"选项,该用户可以在溢出菜单中看到.

I would like to know if there is an extra to enable the Show SD Card option, that user can see in the overflow menu.

推荐答案

添加

intent.putExtra("android.content.extra.SHOW_ADVANCED", true);

但是请注意,这不是官方API的一部分.因此,很有可能会在未来的Android版本中停止工作.

But be aware that this is not part of the official API. So there is a good chance this will stop working in future Android versions.

相关的框架代码可以在这里找到: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/com/android/documentsui/DocumentsActivity.java#255

The relevant Framework code can be found here: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/com/android/documentsui/DocumentsActivity.java#255

这篇关于附加以启用带有存储访问框架(SAF)的显示/隐藏SD卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆