Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open the My Files folder in Android Programatically (using Intent)?

I am using the below code which opens up the Gallery, Music Player, Dropbox and Contacts, i want the My Files folder to get open programatically, please let me know if there are any specific intent parameters i need to pass to get the File Manager open.

if it is not possible through intent then please give me a snippet or an hint to open the My Files folder programatically.

Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
Intent i = Intent.createChooser(intent, "View Default File Manager");
startActivityForResult(i, CHOOSE_FILE_REQUESTCODE); 

Thanks.

like image 660
rkdroid Avatar asked Aug 07 '13 07:08

rkdroid


People also ask

How do I get a list of images in a specific folder on Android?

You can use below code to get all images from specific folder. 1) First you need to define File object to get the storage and appened the name of the folder you want to read. File folder = new File(Environment. getExternalStorageDirectory().


2 Answers

You can use this code to file the files.

int PICKFILE_RESULT_CODE=1;            
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);                 
intent.setType("file/*");              
startActivityForResult(intent,PICKFILE_RESULT_CODE);

this will help you to browse the files from your storage.

like image 172
Aj_31 Avatar answered Nov 07 '22 12:11

Aj_31


If you want to open samsung My Files application try this below code.

Intent intent = new Intent("com.sec.android.app.myfiles.PICK_DATA");              
intent.putExtra("CONTENT_TYPE", "*/*");
startActivityForResult(intent, CHOOSE_FILE_REQUESTCODE); 
like image 39
BobroAlexandr Avatar answered Nov 07 '22 10:11

BobroAlexandr