14

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.

hippietrail
  • 15,848
  • 18
  • 99
  • 158
Yanshof
  • 9,659
  • 21
  • 95
  • 195

2 Answers2

11
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

Community
  • 1
  • 1
redAllocator
  • 725
  • 6
  • 12
2

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

Roaster bhusri
  • 53
  • 1
  • 10