title: Activity getting stuck after trying to get all files with same extension
body: <p>I'm trying to get all files on the device with same extension using:</p>
  
  <pre><code>private void scanForEpubs() {
      File[] file = Environment.getExternalStorageDirectory().listFiles();
      for (File ff : file) {
          if (ff.isDirectory()) scanForEpubs(f);
          if (ff.isFile() &amp;&amp; ff.getName().endsWith(".epub")) {
              Log.d(TAG, "scanForEpubs: " + ff.toString());
          }
      }
  }
  </code></pre>
  
  <p>But that activity gets stuck on a blank screen and doesn't load anything.</p>
  
  <p>Stacktrace gets flooded with just one message:</p>
  
  <pre><code>I/art: Background sticky concurrent mark sweep GC freed 49529(2MB) AllocSpace objects, 0(0B) LOS objects, 9% free, 21MB/23MB, paused 10.291ms total 62.505ms
  </code></pre>