I know this might be a bit late but here is more simpler code :
tabLayout.setTabTextColors(getResources().getColor(R.color.blue_200), getResources().getColor(R.color.white));
first value is the default text color, 2nd value is the selected tab text color.