jeudi 6 mars 2014

setAdapter undefined inside of AsyncTask


Vote count:

0




So I am making an app in which the MainActivity is based mainly around a ListView (in fact, that's all the MainActivity is.) So I extended my MainActivity from ListActivity. The problem is, I'm trying to update my UI Thread from inside of AsyncTask and it is giving me an error that says The method setAdapter(ArrayAdapter<String>) is not defined for the type MainActivity.GetContactInfo


So I'm wondering how do I go about getting setAdapter defined. If I have to actually instantiate a ListView item, which ListView item would I instantiate? I am trying to make a custom layout for my ListView, so I am using a list_item xml file, while my activity_main.xml file has only a ListView in it, so I don't think I would grab that ListView to instantiate a ListView.


Any help on how to simple get setAdapter to work without needing to be attached to a ListView would be helpeful (since I extended my class from ListView I shouln't have to attach that to a ListView is how I see it.)


Thanks in advance.



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire