I created a tab view with four tabs and used viewpager in this tab view. In pager view I set recyclerview. I gave five list items to each recycler view initially each recycler view shows 5 items but while swapping back these items become double.
Solution
By default ViewPage can hold 2 fragments and you are using 4 so after switching to 4 if you go back to 1 it will call onCreate of first fragment and vice versa. to prevent this usage.
mViewPager . setOffscreenPageLimit( 4 );
setOffscreenPageLimit will keep all four fragments in the stack and will prevent re-creation.