I have to load XML data in my app, I'm doing that in a subclass of my activity class extending AsyncTask like this :
public class MyActivity extends Activity {
ArrayList<Offre> listOffres;
private class DownloadXML extends AsyncTask<Void, Void,Void>
{
protected Void doInBackground(Void... params)
{
listOffres = ContainerData.getFeeds();
return null;
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_liste_offres);
DownloadXML.execute(); // Problem here !
for(Offre offre : listOffres) { // etc }
}
}
I don't know how to use execute() here, I have the following error :
Cannot make a static reference to the non-static method execute(Integer...) from the type AsyncTask
I guess some parameters but what ?
Thank you.