android.support.design.widget.TabLayout select Tab Programmatically
This is because that view is still not initialized properly, and you are trying to perform some action.
As a solution you just need to put one hadler before selecting perticular tab.
new Handler().postDelayed(
new Runnable(){
@Override
public void run() {
tabLayout.getTabAt(yourTabIndex).select();
}
}, 100);
This is how I solved it:
tabLayout.getTabAt(CurrentItem).getCustomView().setSelected(true);