title: Clear out android Downloads list
body: <p>I am trying to make an application that will do some cleanup on my device among other things I would like it to delete all of the files residing in my <code>Download</code> dir. I use a method like this to delete the files:</p>
  
  <pre><code>private static void deleteFiles(File path) {
      Util.Log("deleting all files underneath " + path.getName());
      if( path.exists() &amp;&amp; path.isDirectory() ) {
          File[] files = path.listFiles();
          for(int i=0; i&lt;files.length; i++) {
              if(files[i].isDirectory()) {
                  Util.Log(files[i].getName() + " is a dir, being recursive.");
                  deleteFiles(files[i]);
              }else {
                  Util.Log(files[i].getName() + " is a file, deleting it.");
                  files[i].delete();
              }
          }
      }
  }
  </code></pre>
  
  <p>This is properly deleting the files (I have verified with file manager and plugged in to PC). But if I open up the stock "Downloads" application on my device all of the files are still listed in there. When I click on one I get a popup that says "Downloaded file is not found. [Try again] [Delete]. Pressing try again will re-download the file, pressing delete will delete the entry in the list. I am wondering if there is some broadcast or something that I can use to tell this Downloads application that I want it to "refresh" or "sync" with the current file system so that it will recognize that the files have been deleted. </p>
  
  <p>A similar thing occurs when deleting images out of the <code>DCIM</code> dir, they would still appear in the stock 'Gallery' app after deleted. I was able to broadcast a MEDIA_MOUNTED intent that caused the Gallery app to "refresh" with the current files (which then properly removed the images from the Gallery app). However MEDIA_MOUNTED doesn't seem to affect the Downloads application.</p>
  
  <p>Is there anything along the same lines that I can do to tell the Downloads app I want it to refresh its list based on the files currently present (or not present) in the <code>/sdcard/Download/</code> dir?</p>