Reputation: 30395
I have a GridView
backed by an ArrayAdapter
. Everything works except for one thing: I couldn't clear that adapter (need this when refreshing the `GridView).
This is what I have:
adapter.clear();
adapter.notifyDataSetChanged();
Prior to this project I have never had any issue regarding adapter clearing. I can't find what I am doing wrong here.
Any idea? (don't hesitate to ask for specific details).
Thanks!
Upvotes: 1
Views: 2052
Reputation: 30395
Problem solved.
I had to keep a reference on the collection that the adapter was taking its data from and then do:
myCollection.clean();
adapter.notifyDataSetChanged();
Upvotes: 4