如何访问不同的Andr​​oid文件管理器的具体路径? [英] How to access different File Manager specific path in android?

查看:102
本文介绍了如何访问不同的Andr​​oid文件管理器的具体路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了不同类型的文件管理器。不同类型的文件管理器是

I have installed different types of File Manager. The different Types of File Managers are

  1. 在默认的文件管理
  2. ASTRO-文件管理器 - v3.1.342.apk(天文)
  3. 文件管理-1.2.apk(OI文件管理器)
  4. 根浏览器,文件管理器,v1.4.0.apk(根浏览器)

code:

File filePath = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Pictures");
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setDataAndType(Uri.parse("file:/"+filePath.getAbsolutePath()), "file/*");
startActivityForResult(intent,PICKFILE_RESULT_CODE);

在我可以选择天文文件管理器根浏览器默认文件管理器我的位置路径为到/ mnt / SD卡

When I can select Astro File Manager, Root Browser, Default File Manager I got the location path as /mnt/sdcard.

但是,当我访问 OI文件管理器我的位置路径为到/ mnt / SD卡/图片

But when I access the OI File Manager I got the location path as /mnt/sdcard/Pictures.

如何获取和开放的不同类型的文件管理器来访问的位置路径为到/ mnt / SD卡/图片

How do get and open to different types of File Manager to access the location path as /mnt/sdcard/Pictures

在先进的感谢。

推荐答案

指定到一个文件浏览器初始路径?你不能。

Specifying initial path to a file explorer? You can't.

阅读 ACTION_GET_CONTENT 文档。该合同使用这个动作不指定起始位置的。因此,各种文件管理器做不同的事情,它的所有法律和正确的。有些人用你试图输入数据,一些使用最后一个目录,其中用户是,有的开始在SD卡根。

Read documentation for ACTION_GET_CONTENT. The contract for using this action doesn't specify initial location at all. So various file managers do different things, and it's all legal and correct. Some use the data you try to input, some use last directory where user was, some start at root of sdcard.

顺便说一句,你的MIME类型文件/ *看起来像废话,没有这样的已知的MIME类型。只要使用* / *匹配所有文件。

Btw, your mime type "file/*" looks like nonsense, there's no such known mime type. Just use "*/*" to match all files.

这篇关于如何访问不同的Andr​​oid文件管理器的具体路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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