如何从Android应用程序的按钮单击事件中选择一个文件? [英] How to pick a file from button click event for android application?
本文介绍了如何从Android应用程序的按钮单击事件中选择一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的先生,
如何从Android应用程序的按钮点击事件中选择一个文件?
例如 - 单击按钮并从文件夹中选择任何文件(任何位置)以供Android应用程序
请建议我如何实施?
谢谢
Mahendra
Dear Sir,
How to pick a file from button click event for android application?
eg- click the button and pick any file from folder(any where) for android application
Please suggest me How to implement?
Thanks
Mahendra
推荐答案
我不确定Android中是否已有用于文件浏览的小部件。但您可以查看以下文章,了解他们如何编写自己的文件浏览器。
http://android-er.blogspot.in/2012/07/example-of-file-explorer-in-android.html [ ^ ]
http:/ /android-er.blogspot.in/2010/01/implement-simple-file-explorer-in.html [ ^ ]
或者解决方案问题类似于你的问题。
http://stackoverflow.com/questions / 4452880 / file-browsing-in-android [ ^ ]
http://stackoverflow.com/questions/14328109/how-do-i-implement-file -browser-code-that-requires-extends-an-activity [ ^ ]
http://stackoverflow.com/questions/4108881/android-programming-where-to-start-for-创建一个简单的文件浏览器 [ ^ ]
I'm not sure there's already a widget for file browsing in android. But you can check the following articles on how they wrote their own file browsers.
http://android-er.blogspot.in/2012/07/example-of-file-explorer-in-android.html[^]
http://android-er.blogspot.in/2010/01/implement-simple-file-explorer-in.html[^]
Or solutions to the question that is similar to yours.
http://stackoverflow.com/questions/4452880/file-browsing-in-android[^]
http://stackoverflow.com/questions/14328109/how-do-i-implement-file-browser-code-that-requires-extending-an-activity[^]
http://stackoverflow.com/questions/4108881/android-programming-where-to-start-for-creating-a-simple-file-browser[^]
你可以使用intent http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK [ ^ ]
you can use intent http://developer.android.com/reference/android/content/Intent.html#ACTION_PICK[^]
public static final String ACTION_PICK
获取文件名:
startActivityForResult(Intent, int)
要解压缩文件,可以参考 http://stackoverflow.com/questions/5028421/android-unzip-a-folder [ ^ ]
这篇关于如何从Android应用程序的按钮单击事件中选择一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文