I'm getting trouble by doing some simple task with my adapter. I've class that implementing BaseAdapter, associated to a ListView. After I've created this adapter and showed it to the user, if some event occours, I would remove all elements inside adapter, and adding new ones.
I have implement this method inside my BaseAdapter:
public void clearAndBuild(ArrayList<PictureObject> new_pics, String some_text) {
pics.clear();
pics.addAll(new_pics);
this.hashtag = hashtag;
//do something else
}
(where pics is an ArrayList containing items to put inside ListView). In my activity, fo refresh all i call:
adapter.clearAndBuild(pics, tag);
adapter.notifyDataSetChanged();
but it doesn't work. After i call that method, old items inside listView are removed, but new ones is not showed (i get an empty listview). What's wrong?