I currently have a UI that uses an AsyncTask class to make a web service call. This call gets several pictures and stores them in a HashMap. The UI is then notified and the UI is created with these images. However, this sometimes takes as long as 10 – 15 seconds, which is annoying. Is there a way to populate the UI one picture at a time with a background service so that the user starts to see images faster than they currently are?
Thanks.
here is a rough example of how to do this:
Use the
AsyncTask‘sonProgressUpdatemethod to publish progress insidedoInBackground. This method(onProgressUpdate) runs on the UI thread.