I am writing an application for fans of my local cinema , which shows the calendar for the next few days. The list of films for each day is retrieved using a parameterized HTTP call from the site (the answer contains Hebrew, so if you clicked on a link and got some gibberish it's probably OK).
The application displays the schedule for the next eight days, so it makes 8 calls requesting the schedule for the day.
private class GetMoviesTask extends AsyncTask<Integer, Void, List<Film>>
doInBackground() retrieves the list of movies per day, and onPostExecute() updates the interface.
AsyncTask is called from MainActivity.onCreate() :
for (int i=0; i<NUMBER_OF_DAYS_TO_VIEW; i++){ new GetMoviesTask().execute(i); }
The problem is that AsyncTask is not running at the same time. Days load slowly one by one, which is very slow:



What is the best way to run these AsyncCalls at the same time?
source share