在android中打开默认文件管理器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11720032/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:35:08 来源:igfitidea点击:
Open Default File Manager in android?
提问by Bala
My Android Device contains Default File Manager and a Button (Open). How to open the file manager when I click the button?
我的 Android 设备包含默认文件管理器和一个按钮(打开)。单击按钮时如何打开文件管理器?
回答by rfsbraz
Try something like this in your button listener:
在你的按钮监听器中尝试这样的事情:
openButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
startActivity(intent);
}
}