Skip to content Skip to sidebar Skip to footer

How To Update A Specific Item (cardview) In Recyclerview Onactivityresult

I have a Fragment inside MainActivty, and inside this Fragment RecyclerView of Articles with cardView (inside this card i have like button and like counter) and when the user click

Solution 1:

First update the data of that specific position item of adapter.

After that call notifyItemChanged(int) to update that specific CardView of RecyclerView

Notify any registered observers that the item at position has changed. Equivalent to calling notifyItemChanged(position, null);

This is an item change event, not a structural change event. It indicates that any reflection of the data at position is out of date and should be updated. The item at position retains the same identity.

Post a Comment for "How To Update A Specific Item (cardview) In Recyclerview Onactivityresult"