-1

I want to open file manager on a button click and want to get the path of a particular item on selection of that particular item.

Lucifer
  • 29,392
  • 25
  • 90
  • 143

4 Answers4

0

This will give you the "files" directory for your app external / internal.

    context.getExternalFilesDir(null);
    context.getFilesDir();

There's no built in android file picker. You need an entire module / activity. You can perhaps get one searching github, like this one here sounds like what you're looking for.

NameSpace
  • 10,009
  • 3
  • 39
  • 40
0
 File f=new File(Environment.getexternalstoragedirectory());
btn.setonclicklistener(new Onclicklistener){
onClick{  
if(f.isDirectory){

 }else{
//do what u want to do with file 
}}}
raj
  • 2,088
  • 14
  • 23
0

To get SDCard path....

String sdcardPath = Environment.getExternalStorageDirectory().getAbsolutePath();
Hamid Shatu
  • 9,664
  • 4
  • 30
  • 41
0

You can ask the user to select a file using the new Intent.ACTION_OPEN_DOCUMENT intent in KitKat.

Jeff Sharkey
  • 2,473
  • 1
  • 17
  • 10