I have been studying Android for two weeks. Now I am developing my first Android project.
In my project I need to work with Tabs together with action bar. I know that is very common in Android. For action bar I am using toolbar with v7. I seriously know about action bar. But I have an issue with tab layout. The problem is I want to add tabs to tab layout in layout XML file.
For example:
<TabLayout>
//tab buttton goes here
<TabButton1></TabButton1>
<TabButton1></TabButton1>
.
.
<TabLayout>
I search so many tutorials about tablayout. But all tutorials define tabs for tab layout programmatically. How can I define tabs for tab layout in XML and define event for them programmatically by findViewById? I don't want to use button view instead of tabs.