Android中目录的MIME类型 [英] MIME type for directories in Android

查看:312
本文介绍了Android中目录的MIME类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以使用文件浏览器(如果设备上已安装目录)启动用于查看目录的Intent,以便可以打开这样的文件夹:

I was wondering if I can start an Intent for viewing a directory with a File browser (if there's one installed on the device) so I can open a folder like this:

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("file:///sdcard/MyFolder");
intent.setDataAndType(uri, "MIME TYPE FOR FOLDERS");
startActivity(intent);

推荐答案

AndExplorer 有供应商使用AndExplorer作为文件选择器的mime类型:

AndExplorer has vendor mime types to use AndExplorer as a file chooser:

  • vnd.android.cursor.dir/lysesoft.andexplorer.director
  • vnd.android.cursor.dir/lysesoft.andexplorer.file
  • vnd.android.cursor.dir/lysesoft.andexplorer.director
  • vnd.android.cursor.dir/lysesoft.andexplorer.file

有关更多信息,请参见 AndExplorer的开发者文档.我认为其他文件浏览器也具有类似功能,但是我还没有找到他们的文档.

See AndExplorer's developper documentation for more information. I think other file explorers as similar features, but I didn't find their docs yet.

这篇关于Android中目录的MIME类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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