I have created 30 scrollable tabs using tablayout.
So first three tabs are visible on screen and rest of them are invisible which can be scroll using swipe gesture.
tab = tabLayout.getSelectedTabPosition(); tab++; TabLayout.Tab tabs = tabLayout.getTabAt(tab); if (tabs != null) { tabs.select(); } else { tabLayout.getTabAt(0).select(); }
if you want next tab on click event then use this code its work perfactly