Expandable recycler view always collapse on updating adapter

270 views Asked by At

I am using recycler view(https://github.com/thoughtbot/expandable-recycler-view) to display list of sections and subsections. It is working just fine. But when I am trying to update the list with live data and using :- recyclerView.adapter = adapter by creating adapter everytime when live data updates. But when data is updated, it collapses the each section regardless it was expanded already. I want to keep state of list as it was when updating it. Can someone tell me how to achieve this or any other way of updating the adapter that keep the state of list same(if it is expanded, remain expanded, collapsed, remain same). Thanks in advance.

0

There are 0 answers