superkinhluan
superkinhluan

Reputation: 784

Android app: Update UI of some item views in a GridView

I have an Activity that hosts a GridView. When the Activity is resumed, in the OnResume method, I want to update the UI of some item views (but not all) of the GridView because their underlying data has changed. I know that the GridView has the invalidateViews() method, but that is overkill because it recreates all views. In my case, I just want to update some views.

Is there an efficient way to achieve this?

Thanks

Upvotes: 0

Views: 68

Answers (1)

user1578542
user1578542

Reputation:

After changing the data of gridview call adpter with notifydatachanged() after that only it update the gridview with fresh dara

adapter.notifyDataSetChanged();

If you use invalidate views it will create view again

Upvotes: 1

Related Questions