如何使用 Intent 选择文件浏览器来选择文件 [英] How to use intent for choosing file browser to select file

查看:16
本文介绍了如何使用 Intent 选择文件浏览器来选择文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用intent来提示用户选择finish action with"来选择app来选择文件(假设设备中有几个app来浏览文件)

How to use intent to prompt user to choose "finish action with" to choosing app to select file (assuming there is a few app to browse file in the device)

我想使用扩展名过滤文件..(例如:*.sav、*.props)

I want to filter the file using an extension.. (eg. : *.sav, *.props)

提前致谢

推荐答案

你可以这样使用:

    ....  
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    intent.setType("file/*");
    startActivityForResult(intent, YOUR_RESULT_CODE);
    .... 

但是我真的怀疑你可以设置过滤第三方文件浏览器.或者您可以尝试使用此文件对话框:http://code.google.com/p/android-file-dialog/

But I really doubt that you can set a filter third-party file browsers. Or you can try to use this file dialog: http://code.google.com/p/android-file-dialog/

这篇关于如何使用 Intent 选择文件浏览器来选择文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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