I have installed different types of File Manager. The different Types of File Managers are
- Default File Manager
- ASTRO-File-Manager-v3.1.342.apk(Astro)
- FileManager-1.2.apk(OI File Manager)
- Root-Browser-File-Manager-v1.4.0.apk(Root Browser)
Code :
File filePath = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/Pictures");
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setDataAndType(Uri.parse("file:/"+filePath.getAbsolutePath()), "file/*");
startActivityForResult(intent,PICKFILE_RESULT_CODE);
When I can select Astro File Manager
, Root Browser
, Default File Manager
I got the location path as /mnt/sdcard
.
But when I access the OI File Manager
I got the location path as /mnt/sdcard/Pictures
.
How do get and open to different types of File Manager to access the location path as /mnt/sdcard/Pictures
Specifying initial path to a file explorer? You can't.
Read documentation for ACTION_GET_CONTENT. The contract for using this action doesn't specify initial location at all. So various file managers do different things, and it's all legal and correct. Some use the data you try to input, some use last directory where user was, some start at root of sdcard.
Btw, your mime type "file/*" looks like nonsense, there's no such known mime type. Just use "*/*" to match all files.