Search code examples
androidkotlinandroid-tablayout

How to pretend a click on tabLayout in android kotlin?


is it possible to perform a click on child on tanLayout with code not with "real action"? Something like tab[position].performClick()? Does something like this exists?

Greetings


Solution

  • You can select tab using below code:

     tabs.getTabAt(1)?.select()
    

    Hope it will helps!!