title: How to manage multiple Async Tasks efficiently in Android
body: <p>I have scenario where I will have to make six http calls to my server to get the data for six different items. These server calls cant be combined and they are meant to be that way. Eg: If you need quote info for GOOGLE then send a request to server requesting for google's quote info. Next if you need yahoo's then you initiate another http call and so on.</p>
  
  <p>Here is the situation:</p>
  
  <ol>
  <li>Now my end user wants to compare 6 different companies. </li>
  <li>As I mentioned its un-avoidable for me to make 6 http calls for which I do using 6 Async Tasks. </li>
  <li>As I get each one of the Async task response I will refresh the UI with new data.</li>
  <li>Its a bad UI experience if I refresh the UI 6 times in a very short period of time.</li>
  <li>Its give a flickering effect to my UI which is not desired.</li>
  </ol>
  
  <p>My Question:</p>
  
  <ol>
  <li>How can I hold-off from refreshing the UI until I get all the 6 Async Task responses? </li>
  <li>I understand each task is independent of each other. Should I run a while loop and wait until I get all the responses?</li>
  <li>Is there a better way to do this rather than a while loop because if any one of the call doesn't respond then I will stuck waiting forever.</li>
  </ol>
  
  <p>Note: I guess Android 1.6+ do execute Async tasks in parallel.</p>
  
  <p>This is more of a design question and I would appreciate any help on this.</p>
  
  <p>Thanks in advance</p>