Trying to open a specific folder in android using intention

Am I trying to open a specific folder in android? Can I open a specific folder ???? this is the code i m using

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")); } }); 
+6
source share
4 answers
 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")); } 

Another MIME type is also possible, for example, "*/*" .

+2
source

try replacing the code with this line

  btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { 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")); } }); 
+1
source

Works:

 Uri selectedUri = Uri.parse(Environment.getExternalStorageDirectory() + "/myFolder/"); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(selectedUri, "resource/folder"); startActivity(intent); 

You have a good game :)

+1
source

Choose a root:

 Intent selectFile = new Intent(); selectFile.setAction("com.sec.android.app.myfiles.PICK_DATA_MULTIPLE"); selectFile.putExtra("CONTENT_TYPE", "*/*"); selectFile.addCategory(Intent.CATEGORY_DEFAULT); startActivity(selectFile); 
0
source

All Articles