I want to change the visibility of tab items in tablayout according to a value in code. How can I do that?
You can use
tabLayout.removeTabAt(int position)
to remove a tab at a particular position. Then use tabLayout.addTab(Tab tab, int position)
to add it again.