Android : how to execute AsyncTask?
You need to create an instance of your DonwloadXML
file and call execute()
on that method:
DownloadXML task=new DownloadXML();
task.execute();
EDIT: you should probably also return the listOffers
from your doInBackground()
and process the array in the onPostExecute()
method of your AsynTask
. You can have a look at this simple AsyncTask tutorial.
you should call it like:
new DownloadXML().execute();