title: Android filechooser not showing all folders/files but showing some
body: <p>Why filechooser is not showing all (folders and files), but showing some files/folders ?</p>
  
  <p>Android Manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>FileChooser class:</p>
  
  <pre><code>public class FileChooser extends ListActivity {
      private File directory;
      private FileArrayAdapter adapter;
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          directory = new File("/sdcard/");
          fill(directory);
      }
  
      public void fill(File f){
          File[] dirs = f.listFiles();
          this.setTitle("Dir:"+f.getName());
          List&lt;Option&gt; dir = new ArrayList&lt;Option&gt;();
          List&lt;Option&gt; files = new ArrayList&lt;Option&gt;();
          try{
              for(File ff:dirs){
                  if(ff.isDirectory()){
                      dir.add(new Option(ff.getName(),"[+]Pasta ",ff.getPath()));
                  }else{
                      long size;
                      if(ff.length()&gt;0){
                          size=ff.length()/1024;
                      }else{
                          size=ff.length();
                      }
                      files.add(new Option(ff.getName(),"Tamanho "+size+"kb",ff.getPath()));
                  }
  
              }
          }catch (Exception e){}
          Collections.sort(dir);
          Collections.sort(files);
          dir.addAll(files);
  
  
          if(!f.getName().equalsIgnoreCase("")){
              dir.add(0,new Option("..","pasta anterior",f.getParent()));
          }
  
  
          adapter = new FileArrayAdapter(FileChooser.this,R.layout.activity_file_chooser,dir);
          this.setListAdapter(adapter);
      }
      protected void onListItemClick(ListView listView, View view, int position, long id){
          super.onListItemClick(listView,view,position,id);
          Option o = adapter.getItems(position);
  
          if(o.getData().equalsIgnoreCase("[+]Pasta ")||o.getData().equalsIgnoreCase("pasta anterior")){
              directory = new File((o.getPath()));
              fill(directory);
          }else{
              try {
                  Bundle extras = getIntent().getExtras();
                  String classname = extras.getString("class");
                  Class&lt;?&gt; clazz = Class.forName(classname);
                  Intent intent = new Intent(FileChooser.this, clazz);
                  intent.putExtra("path", o.getPath());
                  startActivity(intent);
              }catch (Exception e){
                  Log.d("&gt;&gt;&gt;&gt;", String.valueOf(e));
              }
          }
      }
  }
  </code></pre>
  
  <p>SDFOLDER on Emulator</p>
  
  <p>With filebrowser apk</p>
  
  <p><a href="https://i.stack.imgur.com/bkGrt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bkGrt.png" alt="enter image description here"></a></p>
  
  <p>SDFOLDER or /Storage/Emulated/ on Emulator(Empty)</p>
  
  <p>With my apk</p>
  
  <p><a href="https://i.stack.imgur.com/KwZih.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KwZih.jpg" alt="empty"></a></p>
  
  <p>/sys/kernel/ on Emulator</p>
  
  <p>With my apk (Working fine!)</p>
  
  <p><a href="https://i.stack.imgur.com/L7k4k.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L7k4k.jpg" alt="working"></a></p>