title: Show files in ListView
body: <p>I have a problem: when I press a folder that shown in the <code>ListView</code> I can't open it. 
  I have a Folder class and adapter class. This is my code:</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      path = Environment.getExternalStorageDirectory().getPath();
      file = new File(path);
      folders = new ArrayList&lt;Folders&gt;();
      lv= (ListView) findViewById(R.id.listView1);
  
      adapter= new MyAdapter(getApplicationContext());
      lv.setAdapter(adapter);
      SetList();
  
      lv.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int pos,
                  long arg3) {        
      String  newPath=    adapter.folders.get(pos).getNames()+folders.get(pos).getFiles();
  
      file = new File(path+"/"+newPath);
          String[] newdirs = file.list();
          folders.clear();
          for (int i = 0; i &lt; newdirs.length; i++) {
              Folders fol = new Folders(newdirs[i], newdirs[i].length()+"itemes");
              adapter.folders.add(fol);
          }
          }
      }); 
  }
  public void SetList(){
      String[] dirs = file.list();
      for (int i = 0; i &lt; dirs.length; i++) {
          Folders fol= new Folders(dirs[i], dirs[i].length()+" files");
          adapter.folders.add(fol);
  </code></pre>