45.11 Displaying Icon Tab Items
The last step in this tutorial is to replace the text based tabs with icons. Achieve this by modifying the onCreate() method in the MainActivity.java file to assign some built-in drawable icons to the tab items:
private void configureTabLayout() {
TabLayout tabLayout = findViewById(R.id.tab_layout);
tabLayout.addTab(tabLayout.newTab().setIcon(
android.R.drawable.ic_dialog_email));
tabLayout.addTab(tabLayout.newTab().setIcon(
android.R.drawable.ic_dialog_dialer));
tabLayout.addTab(tabLayout.newTab().setIcon(
...