Hi there is a way to select folder where user want to save file in android . I check out http://code.google.com/p/android-file-dialog/
it has functionality to select file but i want to select folder , please provide me usable link or examples.
Hi there is a way to select folder where user want to save file in android . I check out http://code.google.com/p/android-file-dialog/
it has functionality to select file but i want to select folder , please provide me usable link or examples.
I used the same source in my app (pretty sure), and there is a block of code:
You just have to edit how it handle's
if (file.isDirectory())
. I would recommend declaring aboolean
value in your Activity which you change totrue
if the file is a directory and it is already false. Then if said value is true, then traverse the directory. Also when you change said value totrue
, you would need to callselectButton.setEnabled(true)
. This would be quite a bit less complicated than making your own code, I would say.How about using OI File Manager? This App has the following Intents:
PICK_FILE
,PICK_DIRECTORY
. There is even sample code on the page for using the Intents.I encountered the same issue and I end up using NoNonsense-FilePicker
Add to gradle file
Trigger file/folder/dir pick
Handle Activity result to get selected file or files
Check out this answer https://stackoverflow.com/a/28479561/779140 I am mentioned library author so don't hesitate to ask any questions.