如何使用意向选择文件的浏览器来选择文件 [英] How to use intent for choosing file browser to select file
本文介绍了如何使用意向选择文件的浏览器来选择文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用意图提示用户选择完成与行动,选择应用程序,选择文件(假设有几个应用程序来浏览设备文件)
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);
....
不过,我真的怀疑,你可以设置一个过滤器第三方文件浏览器。 或者你可以尝试使用这个文件对话框:<一href="http://$c$c.google.com/p/android-file-dialog/">http://$c$c.google.com/p/android-file-dialog/
But I realy 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/
这篇关于如何使用意向选择文件的浏览器来选择文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文