Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I click tab in TabLayout by coding or method?

I have problem when Toolbar collapse. The CoordinatorLayout is not collapse. This problem is cause by I call keyboard. but when I click Tab in TabLayout the CoordinatorLayout is working correct again.

That is why I want to click tab in TabLayout by coding or method.

UPDATE: This question is relate with this LINK

like image 904
Pagorn Avatar asked Dec 06 '25 05:12

Pagorn


1 Answers

I have to find the method for myself just to achieve this:

 TabLayout.Tab newTab =  tabLayout.getTabAt(int indexnumber); 
 newTab.select();

Hope that helps you.

PS. This is using the TabLayout class on the Android design library

like image 128
Pier Betos Avatar answered Dec 07 '25 22:12

Pier Betos



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!