title: How to use ExecutorService with Android AsyncTask?
body: <p>I need to execute a number of <code>AsyncTask</code>s and then gather all their results, consolidate and then return the final result to my user. </p>
  
  <p>I am looking at a way to manage multiple <code>AsyncTask</code>s in Android. I am thinking of using a <code>ExecutorService</code> from the Java Concurrency package but I stuck because <code>ExecutorService</code> takes either Runnables or Callables ONLY. To establish my requirement I can use the </p>
  
  <p><code>ExecutorService.invokeAll((Collection&lt;? extends Callable&lt;T&gt;&gt; tasks)</code> </p>
  
  <p>The <code>invokeAll()</code> method will return a list of <code>List&lt;Future&gt;&lt;V&gt;&gt;</code> only when all submitted tasks are completed and I can get my results for each task from its corresponding <code>Future</code>.</p>
  
  <p>All is well with <code>ExecutorService</code> expect for the fact that it doesn't accept <code>AsyncTask</code>.</p>
  
  <p>Is there any other way to use <code>AsyncTask</code> and <code>ExecutorService</code> or if you can please recommend a different approach.</p>