在android中打开目录(文件夹)

时间:2015-07-15 09:00:34

标签: android

打开文件夹的代码是什么,/storge/sdcar0/0students/就像下图中的屏幕一样



        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
        Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
                + "/0students/");
        intent.setDataAndType(uri, "*/*");
        startActivity(Intent.createChooser(intent, "Open folder"));




我已使用此代码,但不是必需的

enter link description here

1 个答案:

答案 0 :(得分:0)

要打开目录 0students ,请尝试此操作。

 Uri uri = Uri.parse(Environment.getExternalStorageDirectory() + "/0students/");

 Intent intent = new Intent(Intent.ACTION_VIEW);
 intent.setDataAndType(uri, "resource/folder");


 if (intent.resolveActivity(getPackageManager()) != null){
        startActivity(intent);
 }