GridLayout setAdapter

2k Views Asked by At

I need to notify an image inside the Gridlayout is changed. Using the GridView it is easy:

adapterForImage.notifyDataSetChanged();
gridview.setAdapter(adapterForImage);

How can I do with the GridLayout? Thanks

1

There are 1 best solutions below

0
On

GridLayout isn't tied to an adapter like GridView is. My suspicion is that you just want to use something like a CursorLoader, which will automatically register a content observer. When the content associated with the provider changes, you can invalidate the whole GridLayout --- or you can invalidate just the views that you know need to be updated.