I struggled with a similar problem, trying to handle a use-case where the entire contents of the adapter should be replaced and the recycler should start from scratch: calling notifyDataSetChanged() , swapAdapter() using numerous combinations of subsequent calls to view / layout-manager invalidation requests led to a simple (apparently) empty form of recyclers. The view did not even try to double-check the owners of the views.
What seemed to work is a hack-ish fix:
view.swapAdapter(sameAdapter, true); view.scrollBy(0, 0);
As it turned out, scrollBy (even with 0 offsets) controls the viewing of the recycler, laying out its views and performing rewritable viewfinders.
source share