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
You might have to elaborate on how you're using a tab layout, but if you have your TabLayout setup with a ViewPager like this:
then you can call .setCurrentItem(int) on the ViewPager like this:
to programatically set the page number. When you have your TabLayout setup with a Viewpager as shown, this will also change your tab in the TabLayout. Here I've set it to 1. Hope this helps!