I am getting the new list with new item at the start in my live data and then using its data to update the adapter
viewModel.myLiveData.observe { this, Observer
Use this way
viewModel.myLiveData.observe { this, Observer { myList ->
adapter.submitList(myList) // Assuming you are notifying adapter by notifydatasetchanged()
recyclerView.post { recyclerView.scrollToPosition(0) }
}
Here post
is giving UI Thread some time to populate Recycler with new data and then call scrollToPosition
.