0

I am new to android development. I need to implement a file chooser/ Open-File-Dialog in my project. But I have found that android do not provide any built in support for this. So what is good solution on this? Should I use any Library or Manually build code for this?

I have taken overview of android-fileChooser & aFileChooser Libraries. Is there any other simple file chooser?

Thanks in advanced...

AnujDeo
  • 333
  • 1
  • 4
  • 13

3 Answers3

6

Use this following code to start a intent to a file chooser

Intent fileIntent = new Intent(Intent.ACTION_GET_CONTENT);
fileIntent.setType("file/*"); // intent type to filter application based on your requirement
startActivityForResult(fileIntent, RESULT_CODE);
Moses
  • 916
  • 8
  • 14
  • 2
    I have tried it, but It works only if there is External File explorer installed. Gives error other wise :-( – AnujDeo Jun 03 '13 at 12:24
  • where did you get this code ? – Francisco Corrales Morales Nov 26 '14 at 16:11
  • This works pretty fine for me. Even the thing of giving error if no internal file explorer is present is fine, because I need to respect if in enterprise environment the user is not intended to see the files on SD or internal memory. Only wish would be to check it in advance, so the button to open the file chooser could be hidden. – Schlangi Oct 26 '15 at 07:45
1

Some more links for your reference File Explorer and File Explorer 1

Community
  • 1
  • 1
Srikanth Roopa
  • 1,782
  • 2
  • 13
  • 19
0

Check this out: FileExplorer with sorting I'm using it and it's the most complete file explorer I found.

Mongi Zaidi
  • 1,043
  • 10
  • 15
  • @ Mongi Zaidi: Thanks.. But this isnt what I want. I dont want a full file explorer. I just want to make user able to choose a file of hise choice.. – AnujDeo Jun 03 '13 at 12:26