There are many examples how to push new list to adapter on LiveData change.
I\'m trying to update one row (e.g number of comments for post) in the huge list. It would be
add context
to your adapterClass
construstor : AdpaterClass(context: Context)
then smart cast the context
to AppCompactActivity
livedata.observe(context as AppCompatActivity, Observer {it ->
//perform action on it(livedata.value)
})
when calling the adapter
from anywhere activity
, fragment
pass the context
into the adpater