Reputation: 63
i have a grid view with images populated from a list. when i remove an image from the list,i want the grid view to get refreshed.can someone tell me how to do this.
i have tried to invalidate() the gridview, notify the image adapter that the data set has changed(adapter.notifyDataSetChanged();). but this is not giving the desired results.
after doing this i am getting a blank in the place where the image that is removed used to be before.
Upvotes: 2
Views: 3272
Reputation: 118
Try to use gridView.invalidateViews() instead of just .invalidate(). It redraws all views (ImageViews in your case) inside gridView.
Upvotes: 8
Reputation: 18670
Do you use a ListAdapter to populate your view ? Maybe you should recreate a new adapter when your list changes.
Upvotes: 0