+-
尝试使用intent打开android中的特定文件夹
我想在 android中打开一个特定的文件夹?是否可以打开一个特定的文件夹????这是我正在使用的代码

    config=(Button)findViewById(R.id.btn_cf);

      config.setOnClickListener(new View.OnClickListener() 
      {         
            @Override
            public void onClick(View v)
            { 

            Intent intent = new Intent("Intent.ACTION_GET_CONTENT"); 
             Uri uri = Uri.parse("mnt/sdcard/myfiles/allfiles/download"); 
            intent.setDataAndType(uri, "*/*"); 
            startActivity(Intent.createChooser(intent, "download"));


            }
       });
最佳答案
public void openFolder()
{
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
    + "/myFolder/");
intent.setDataAndType(uri, "text/csv");
startActivity(Intent.createChooser(intent, "Open folder"));
}

另一种MIME类型如“* / *”也是可能的.

点击查看更多相关文章

转载注明原文:尝试使用intent打开android中的特定文件夹 - 乐贴网