Choose folder on Android device

2019-02-08 19:48发布

问题:

I would like to let user pick directory and save downloaded file (my app downloads file). I know that some tools (for example, ES File Explorer) provide such intent-filters. see http://www.estrongs.com/en/support/developers.html. I start activity for result and then get selected folder as a result.

Also, I know that there are no "select folder" intent standards (I can't use the same intent with other tools). Do you know other tools to support such functionality ? I would like to let user use his tool, not ES File Manager.

Also, does Astro provide such intent filters? I can't find this info on their page. (I think astro is the most used file manager for android)

回答1:

I've recently come across something that might potentially help here: http://www.openintents.org/en/node/159

It has a demo application showing how it can interact with third party applications as a file/directory picker.

That said, I have not tried it yet. I stumbled across this question as I am still looking for other options.

Edit: actually, it looks very similar to your ES File Manager link. Perhaps it is merely a clone.



回答2:

Here is complete Android library: https://github.com/lemberg/directory-selector-dialog-preference

It can be used either as DialogFragment or as DialogPreference. I am it's author so don't hesitate to ask any questions.