Yanshof
Yanshof

Reputation: 9926

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.

Upvotes: 14

Views: 13422

Answers (2)

redAllocator
redAllocator

Reputation: 735

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

Upvotes: 12

Roaster bhusri
Roaster bhusri

Reputation: 53

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

Upvotes: 2

Related Questions