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.
Asked
Active
Viewed 923 times
-1
-
Check this: http://stackoverflow.com/questions/13361024/how-to-get-the-internal-and-external-sdcard-path-in-android – Lokesh Mar 11 '14 at 05:23
-
Check this too : http://stackoverflow.com/a/11281048/2269789 – enadun Mar 11 '14 at 05:25
-
try out this link: https://developers.inkfilepicker.com/docs/android/ – Harshal Benake Mar 11 '14 at 05:39
4 Answers
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