I’m not sure why it is but I cannot call a method in my asynctask that is not static.
protected void onPostExecute(String result) {
List<SingleEvent> thelist = PhotosActivity.parseJSONResponse(result);
PhotosActivity.refreshListView(thelist);
}
The method in my activity:
public void refreshListView(List<SingleEvent> theList){//method that adds the List to the ListView after asyncTask is finished.
SingleEventAdapter adapter = new SingleEventAdapter(this, theList);
this.list.setAdapter(adapter);
adapter.notifyDataSetChanged();
}
It says I should make my method static, but in doing so the code inside gets errors saying it cannot be used with static.
EDIT:
The following is my asynctask class:
public class CallWebServiceTask extends AsyncTask<String, Object, String> {}
it’s not static?
You must do this (make sure your
AsyncTaskclass is not static):