title: Set multiple image-View sources by downloading the URLS with JSoup?
body: <p>This is in Android using Android Studio</p>
  
  <p>I'm trying to Download a few image URLs from a website and then set it as source for image Views.</p>
  
  <p>the first notable thing is that the number of URLs that the JSoup will return can be different each time as the the site changes.</p>
  
  <p>First problem was that i had two AsyncTask one which gets the URLS with JSoup second one which sets the Downloaded URLs sources for Image Vies But i encountered a problem where the second task stops after one URL since they both run at the same time so i put the second task in the OnPostExecute method.</p>
  
  <p>at this point i have a lot of problem with setting the Image View sources as the doInBackground method for downloading the bitmap from URL takes some time to finish each time it is ran.</p>
  
  <p>but my for loop which the task is in doesn't wait for the task to finish and just runs the task one after another which results in Task Already running Exception.</p>
  
  <p>So i added this check in the for loop <strong>downloadImages.getStatus() == Status.FINISHED</strong>
  but the problem is that as it gets to the second time to run this method the for loop evaluates in false which causes the for loop to break.</p>
  
  <p>Now the question is, how can i solve this or is there a better way to do these tasks ?</p>
  
  <p>PS:i am really new to java and Android.</p>