Yes, an AsyncTask
would be good for this.
- Show whatever image/layout you want while loading in
onPreExecute()
. You can use aProgressDialog
/ProgressBar
if you want or show something else here. - Do your parsing in
doInBackground()
- Then dismiss your
ProgressDialog
/ProgressBar
, image, or whatever you decide to use inonPostExecute()
. Also, update yourAdapter
in this method. - You can make the
AsyncTask
an inner class of yourActivity
if you don't need it anywhere else to make it easier.
Be sure you read through the AsyncTask Docs a couple times to understand how they work.