Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select folder dialog on android?

Is there some 'select folder dialog' on android SDK ? I google it and i did not find anything.

I mean that i looking for dialog that will popup and give me the option to select a path of folder ( like select file dialog ... but the return argument will be full path of a folder )

Its hard to believe that on this marvelous sdk there is no way to select full folder path.

Any help please ..

thanks.

like image 766
Yanshof Avatar asked May 21 '17 08:05

Yanshof


2 Answers

public void performFileSearch() {
   Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
   startActivityForResult(intent, READ_REQUEST_CODE);
}

Or If you using samsung phone, You can call Intent.

//Samsung Device
    Intent intent = new Intent("com.sec.android.app.myfiles.PICK_DATA");
    intent.putExtra("CONTENT_TYPE", "*/*");
    intent.addCategory(Intent.CATEGORY_DEFAULT);

providers/document-provider

This link will be help for you

like image 67
redAllocator Avatar answered Nov 20 '22 22:11

redAllocator


you can use this library to do the same: https://github.com/passy/Android-DirectoryChooser

like image 38
Roaster bhusri Avatar answered Nov 20 '22 22:11

Roaster bhusri