0
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("file/*");
startActivityForResult(intent,PICKFILE_RESULT_CODE);


protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  // TODO Auto-generated method stub
  switch(requestCode){
      case PICKFILE_RESULT_CODE:
       if(resultCode==RESULT_OK){
        String FilePath = data.getData().getPath();
    textFile.setText(FilePath);
       }
       break;

      }
     }
    }

But it is showing only empty directories and not files inside them. I have astro installed on phone

  • refer [this ][1] answer also check if you have required permissions [1]: http://stackoverflow.com/questions/8945531/pick-any-kind-file-via-an-intent-on-android# – Sourabh Saldi Jul 19 '14 at 08:00
  • No it does not show only directories which are empty. It shows all directories. But no files. You could have started to tell which picker you use as i know of at least one who behaves that way. – greenapps Jul 19 '14 at 09:56
  • i am using astro and yes u r right it is showing all directories but no files. That's what i meant . My bad if i was not clear. P.S how to view files inside directories then? – user3855373 Jul 19 '14 at 10:18

2 Answers2

0

do you have required permission in your app to read external files??

you may refer this answer as well refer here

Community
  • 1
  • 1
Sourabh Saldi
  • 3,567
  • 6
  • 34
  • 57
0

Okay i got it working by usin ( * / * ) instead of (files/*) but now i have problem playing them. Solutions are welcome