Answer:
setIcon
Step-by-step explanation:
In design support library the components like nav bar, floating action button, snackbar, tabs, labels and animation frameworks we use icons and different other designs to look theme appealing.
So the icon can be specified for a tab using the setIcon method.
tabLayout.getTabAt(0).setIcon(tabIcons[0]);
tabLayout.getTabAt(1).setIcon(tabIcons[1]);