Most of the time a TabLayout is used together with a ViewPager, in order to get the swipe functionality that comes with it.
It is possible to use a TabLayout without a ViewPager by using a TabLayout.OnTabSelectedListener.
First, add a TabLayout to your activity's XML file:
<android.support.des...