TabItem

TabItem is a View which contains an icon and a text. It has two states — selected and unselected. It must be “attached” to a TabLayout . However, according to the Google official documentation (see below quote) , it is a dummy View which is not actually “added” to a TabLayout . As a result, findViewById() will always return null and developer cannot customise each tab by referring to it directly.

TabItem is a special ‘view’ which allows you to declare tab items for a TabLayout within a layout. This view is not actually added to TabLayout, it is just a dummy which allows setting of a tab items's text, icon and custom layout. See TabLayout for more information on how to use it. Reference: Google documentation about TabItem