So, I imagine this is pretty easy but I can't quite do it - I'm trying to poplate a ListView with data in an array and like a good little boy, I'm using an ArrayAdapter to populate the Listview within the onCreate method of a ListActivity:
I have another class, in which I'm using AsyncTask to retrieve data from a WebService. The method onPostExecute, which runs when the AsyncTask is done, contains my data in the form of an ArrayList<String>. It is below:
As you can see, I'm trying to set the public ArrayAdapter arAdap from this method in the AsyncTask class. I know there's good data in here because I was previously passing it to a simple TextView in the "start" class.
However, I'm getting errors (I'm sure related to context) because the "this" mentioned in the AsyncTask class is obviously not the same as the "this" in the actual ListView class.
So......how to do context for setting the ListView contents from this seperate class?
Or is there a better way to do it entirely that I totally missed? I'm open at this point. Thanks!