Gridview images not updated

I have a grid with images filled from a list. when I remove an image from the list, I want the grid view to be updated. Tell me how to do it.

I tried to invalidate () the gridview, notify the image adapter that changed the data set (adapter.notifyDataSetChanged ();). but it does not give the desired results.

after that I get an empty place where the image was previously deleted.

+3
source share
2 answers

Is the ListAdapter used to populate your view? Perhaps you should recreate the new adapter when your list changes.

0
source

gridView.invalidateViews() .invalidate(). (ImageViews ) gridView.

+9

Source: https://habr.com/ru/post/1784909/


All Articles