title: How to add tabs to TabLayout in layout XML file in Android?
body: <p>I have been studying Android for two weeks. Now I am developing my first Android project.</p>
  
  <p>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.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;TabLayout&gt;
  //tab buttton goes here
   &lt;TabButton1&gt;&lt;/TabButton1&gt;
   &lt;TabButton1&gt;&lt;/TabButton1&gt;
   .
   .
  &lt;TabLayout&gt;
  </code></pre>
  
  <p>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.</p>