title: How is TabItem used when placed in the layout XML?
body: <p>The <a href="https://developer.android.com/reference/android/support/design/widget/TabLayout.html" rel="noreferrer"><code>TabLayout</code> documentation</a> gives an example of nesting <code>TabItem</code> directly inside <code>TabLayout</code> like so:</p>
  
  <pre><code>&lt;android.support.design.widget.TabLayout
       android:layout_height="wrap_content"
       android:layout_width="match_parent"&gt;
  
      &lt;android.support.design.widget.TabItem
           android:text="@string/tab_text"/&gt;
  
      &lt;android.support.design.widget.TabItem
           android:icon="@drawable/ic_android"/&gt;
  
  &lt;/android.support.design.widget.TabLayout&gt;
  </code></pre>
  
  <p>But it gives no example of how this could be used in practice, and the documentation for TabItem says:</p>
  
  <blockquote>
    <p>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. </p>
  </blockquote>
  
  <p>So what is <code>TabItem</code> for? After extensive Googling, I cannot find a single example of anyone defining TabItems in XML. Is there any way to set up a tabbed activity using TabItem in the resource file as shown above? </p>