I have sample project with TabLayout and PagerAdapter. Strange things happens with TabLayout when I call pagerAdapter.notifyDataSetChanged();
TabLayout
PagerAdapter
pagerAdapter.notifyDataSetChanged();
You can call:
setupWithViewPager(@Nullable final ViewPager viewPager, boolean autoRefresh)
and set param autoRefresh to false.
autoRefresh
false
See also: TabLayout(ViewPager,boolean)