attach

open fun attach()

Link the TabLayout and the ViewPager2 together. Must be called after ViewPager2 has an adapter set. To be called on a new instance of TabLayoutMediator or if the ViewPager2's adapter changes.

Throws

If the mediator is already attached, or the ViewPager2 has no adapter.