I just searched the forums, and apparently this is a common problem.
ListView with a custom adapter based on BaseAdapter.
Its backed by a List object.
The problem is that updating the data and calling notifyDataSetChanged();
does nothing.
I have modified the adapter so that ever method that is called in it prints
itself to the console.
my adapter has a method that does the update of the contents and attempts to
notify:
public void updateData(List<Event> data) {
this.data.clear();
this.data.addAll(data);
notifyDataSetChanged();
}
The problem is that after notifyDataSetChanged() is called, the list never
calls any other methods, not even getCount().
My data has changed, and i've notified ListView that it has, yet it still
refuses to update.
After some investigation in the OS source, I don't see where the observer in
the list actually tells the list to update.
It seems the only way to get the list to update its elements is to re-set
the adapter on it with the new element set.
Now I've seen many threads in the group saying that they user was doing
something wrong... but I don't see how the notify is going to update the
list period (change or no change).
So, I think i'm dealing with a bug here.
Can someone actually find the code that does the update in the ListVIew when
adapters notifyDataSetChanged() is called?
- Brill Pappin
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en