文件名称:FileSelector
介绍说明--下载内容均来自于网络,请自行研究使用
private void ShowSelectFiles(){
String actionName = "SelectFiles" // 动作名
Intent i=new Intent(actionName) // 以下参数都不是必须的,参数名区分大小写
i.putExtra("Single", true) // 是否只能选择一个文件
i.putExtra("Path", "/mnt/") // 起始目录
i.putExtra("Type", "File") // 允许选择文件(File) 还是目录(Folder) 还是都可以(All)
i.putExtra("Pattern", "\\.(wma|mp3|mid|wav)$") // 文件名必须匹配的正则表达式
try{
startActivityForResult(i,0)
}catch(Exception ex){
Toast t =Toast.makeText(this, "请安装文件选择器", 1000)
t.setGravity(Gravity.CENTER, 0, 0)
t.show()
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(resultCode==Activity.RESULT_OK){
ArrayList<String> listFile = data.getStringArrayListExtra("Result")
//处理选中的文件....
}-file select this is file select
String actionName = "SelectFiles" // 动作名
Intent i=new Intent(actionName) // 以下参数都不是必须的,参数名区分大小写
i.putExtra("Single", true) // 是否只能选择一个文件
i.putExtra("Path", "/mnt/") // 起始目录
i.putExtra("Type", "File") // 允许选择文件(File) 还是目录(Folder) 还是都可以(All)
i.putExtra("Pattern", "\\.(wma|mp3|mid|wav)$") // 文件名必须匹配的正则表达式
try{
startActivityForResult(i,0)
}catch(Exception ex){
Toast t =Toast.makeText(this, "请安装文件选择器", 1000)
t.setGravity(Gravity.CENTER, 0, 0)
t.show()
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(resultCode==Activity.RESULT_OK){
ArrayList<String> listFile = data.getStringArrayListExtra("Result")
//处理选中的文件....
}-file select this is file select
(系统自动生成,下载前可以参看下载内容)
下载文件列表
FileSelector\可安装文件\读我.txt
............\bin\resources.ap_
............\...\FileSelector.apk
............\可安装文件\FileSelector.apk
............\proguard.cfg
............\bin\cn\yishou\fileselector\FileSelector$1.class
............\...\..\......\............\FileSelector$2.class
............\...\..\......\............\FileSelector$3.class
............\...\..\......\............\FileSelector$4.class
............\...\..\......\............\FileSelector$5.class
............\...\..\......\............\FileSelector$6.class
............\...\..\......\............\FileSelector$TargetFileTypes.class
............\...\..\......\............\FileSelector.class
............\...\..\......\............\R$attr.class
............\...\..\......\............\R$drawable.class
............\...\..\......\............\R$id.class
............\...\..\......\............\R$layout.class
............\...\..\......\............\R$string.class
............\...\..\......\............\R.class
............\.classpath
............\bin\classes.dex
............\src\cn\yishou\fileselector\FileSelector.java
............\gen\cn\yishou\fileselector\R.java
............\.project
............\default.properties
............\AndroidManifest.xml
............\res\layout\main.xml
............\...\values\strings.xml
............\...\drawable-ldpi\icon.png
............\...\.........mdpi\icon.png
............\...\.........hdpi\icon.png
............\bin\cn\yishou\fileselector
............\gen\cn\yishou\fileselector
............\src\cn\yishou\fileselector
............\bin\cn\yishou
............\gen\cn\yishou
............\src\cn\yishou
............\bin\cn
............\gen\cn
............\src\cn
............\res\drawable-hdpi
............\...\drawable-ldpi
............\...\drawable-mdpi
............\...\layout
............\...\values
............\assets
............\bin
............\gen
............\res
............\src
............\可安装文件
FileSelector
............\bin\resources.ap_
............\...\FileSelector.apk
............\可安装文件\FileSelector.apk
............\proguard.cfg
............\bin\cn\yishou\fileselector\FileSelector$1.class
............\...\..\......\............\FileSelector$2.class
............\...\..\......\............\FileSelector$3.class
............\...\..\......\............\FileSelector$4.class
............\...\..\......\............\FileSelector$5.class
............\...\..\......\............\FileSelector$6.class
............\...\..\......\............\FileSelector$TargetFileTypes.class
............\...\..\......\............\FileSelector.class
............\...\..\......\............\R$attr.class
............\...\..\......\............\R$drawable.class
............\...\..\......\............\R$id.class
............\...\..\......\............\R$layout.class
............\...\..\......\............\R$string.class
............\...\..\......\............\R.class
............\.classpath
............\bin\classes.dex
............\src\cn\yishou\fileselector\FileSelector.java
............\gen\cn\yishou\fileselector\R.java
............\.project
............\default.properties
............\AndroidManifest.xml
............\res\layout\main.xml
............\...\values\strings.xml
............\...\drawable-ldpi\icon.png
............\...\.........mdpi\icon.png
............\...\.........hdpi\icon.png
............\bin\cn\yishou\fileselector
............\gen\cn\yishou\fileselector
............\src\cn\yishou\fileselector
............\bin\cn\yishou
............\gen\cn\yishou
............\src\cn\yishou
............\bin\cn
............\gen\cn
............\src\cn
............\res\drawable-hdpi
............\...\drawable-ldpi
............\...\drawable-mdpi
............\...\layout
............\...\values
............\assets
............\bin
............\gen
............\res
............\src
............\可安装文件
FileSelector