title: How to get files in cache directory in android?
body: <p>In my android app, I make files in a directory I get using this function (notice its putting in a subdirectory).</p>
  
  <pre><code>gsFile = new File(getCacheDir(), "test/aa.txt");
  </code></pre>
  
  <p>But how do I iterate through the files in that directory now?</p>
  
  <p>I tried</p>
  
  <pre><code>File dir = new File(getCacheDir(), "test/aa.txt");
  for (File f : dir.listFiles()) {
  
  }
  </code></pre>
  
  <p>but it crashed on File f</p>