-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
  • 28,933
  • 23
  • 88
  • 140

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
  • 9,696
  • 3
  • 37
  • 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,068
  • 13
  • 23
0

To get SDCard path....

String sdcardPath = Environment.getExternalStorageDirectory().getAbsolutePath();
Hamid Shatu
  • 9,503
  • 4
  • 29
  • 40
0

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

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