title: Android - DownloadManager - Clear old downloads in queue
body: <p>I'm building an app which needs to know for concurrency reasons if all downloads are finished. A certain function is only allowed to start when all my downloads are finished.</p>
  
  <p>I managed to write a function which checks the queue for old downloads:</p>
  
  <pre><code>DownloadManager dm = (DownloadManager) context.getSystemService(context.DOWNLOAD_SERVICE);
  
      Query q = new Query();
      q.setFilterByStatus(DownloadManager.STATUS_FAILED|DownloadManager.STATUS_PENDING|DownloadManager.STATUS_RUNNING);
  
      Cursor c = dm.query(q);
  </code></pre>
  
  <p>The problem is that - just to be sure - at initialization I want to clean up the queue and remove all entries.</p>
  
  <p>Any ideas how I can now remove the entries? </p>
  
  <p><a href="http://developer.android.com/reference/android/app/DownloadManager.html#remove%28long...%29" rel="noreferrer">This function</a> didn't work for me because I don't want to physically delete the files...just empty the queue.</p>
  
  <p>Any ideas?</p>