when calling notifyDataSetChanged
on RecyclerView
it doesn\'t retain the scroll position and scrolls to top, is there any solution to retain it\'s
notifyItemChanged() make the RecyclerView scroll and jump to UP
android:descendantFocusability="blocksDescendants"
Horizontal recyclerView inside vertical recyclerView generally causes that problem and this is best approach to get rid of problem. Don't put this attr into horizontal recyclerViews, it needs to be in only Parent (vertical RecyclerView).
RecycleViews will scroll back to the top on any variant of notifyDataSetChanged
if they don't have a layout manager. Here's an example of how to set one.
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context, OrientationHelper.VERTICAL, false);
recycleView.setLayoutManager(linearLayoutManager);