java - Android call notifyDataSetChanged from AsyncTask -
i've custom listadapter fetches data internet in asynctask. the data added list, when try operations application crashes... i'm sure because i'm calling notifydatasetchanged(); @ wrong time (i.e. before asynctask ends). what i've got now: public class mylistadapter extends baseadapter { private arraylist<string> mstrings = new arraylist<string>(); public mylistadapter() { new retreivestringstask().execute(internet_url); //here call notify function **************** this.notifydatasetchanged(); } class retreivestringstask extends asynctask<string, void, arraylist<string>> { private exception exception; @override protected arraylist<string> doinbackground(string... urls) { try { url url= new url(urls[0]); //return arraylist return getstringsfrominternet(url);; } catch (exception e) { ...