title: Android program crash and .android_secure
body: <p>I was working on an mp3 player android project for varsity that so far just consists of a single activity that recursively adds all mp3 files on the phones sd card. </p>
  
  <p>My app just kept crashing and after a lot of debugging I noticed the reason is that it finds a hidden directory /sdcard/.android_secure and when it attempts to call listFiles() on this directory the app crashes. I got around around the problem by excluding hidden files from being processed.</p>
  
  <p>My question is what exactly is going on here? I assume my app doesn't have permission to access the contents of .android_secure. Is there a more robust way of scanning through an sdcard? </p>
  
  <p>I've add the related code below. Any help is appreciated.</p>
  
  <pre><code>    File storage = Environment.getExternalStorageDirectory();
      addMp3Files(storage);
  }
  
  private void addMp3Files(File rootDir) {
      for (File file : rootDir.listFiles()) {
          if (file.getName().toLowerCase().endsWith(".mp3")) {
          songs.add(file.getAbsolutePath());
          } else if (file.isDirectory() &amp;&amp; !file.isHidden()) {
              addMp3Files(file);
          }
      }
  }
  </code></pre>