title: How to delete all files and folders in one folder on Android
body: <p>I use this code to delete all files:</p>
  
  <pre><code>File root = new File("root path");
  File[] Files = root.listFiles();
  if(Files != null) {
      int j;
      for(j = 0; j &lt; Files.length; j++) {
          System.out.println(Files[j].getAbsolutePath());
          System.out.println(Files[j].delete());
      }
  }
  </code></pre>
  
  <p>It will delete false where <code>Files[j]</code> is a folder.</p>
  
  <p>I want to delete folder and all its sub files.<br>
  How can I modify this?  </p>