java - how can i create an arrayadapter in asynctask. onPostExecute -


protected void onpostexecute(string s) {     veriadaptoru=new arrayadapter<string>       (this, android.r.layout.simple_list_item_1, android.r.id.text1, a);    liste=(listview)findviewbyid(r.id.listview1);    liste.setadapter(veriadaptoru);       } 

i have write code in part error

(veriadaptoru=new arrayadapter<string>            (this, android.r.layout.simple_list_item_1, android.r.id.text1, a);) 

the problem in new arrayadapter<string> (this, android.r.layout.simple_list_item_1, android.r.id.text1, a); must load context activity, if write this in onpostexecute another. make in activity class variable

context context = myactivity.this; 

if asynctask in class - create constructor , pass context activiy in it. , can do

 (context, android.r.layout.simple_list_item_1, android.r.id.text1, a);` 

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -