title: Including views using merge tag and ViewStub
body: <p>I wanted to extend my <code>TableLayout</code> with some additional rows through <code>ViewStab</code> element. This is my <code>Activity</code>'s layout:</p>
  
  <pre><code>&lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:id="@+id/root_table_layout"&gt;
  
      &lt;TableRow&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Row 1"/&gt;
      &lt;/TableRow&gt;
  
      &lt;TableRow&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Row 2"/&gt;
      &lt;/TableRow&gt;
  
      &lt;ViewStub
          android:id="@+id/view_stub_1"
          android:layout="@layout/merge_table_1"/&gt;
  
      &lt;ViewStub
          android:id="@+id/view_stub_2"
          android:layout="@layout/merge_table_2"/&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p>Either <code>view_stub_1</code> or <code>view_stub_2</code> is inflated on <code>Activity</code> <code>onCreate</code> (it depends on app's condition).</p>
  
  <p><code>ViewStub</code> was supposed to inflate a layout defined with <code>&lt;merge&gt;</code> tag as the root element. Like this:</p>
  
  <pre><code>&lt;merge xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;TableRow&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Row 5"/&gt;
      &lt;/TableRow&gt;
  
      &lt;TableRow&gt;
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Row 6"/&gt;
      &lt;/TableRow&gt;
  
  &lt;/merge&gt;
  </code></pre>
  
  <p>But when the <code>Activity</code> was about to start, I got this exception:</p>
  
  <blockquote>
    <p>merge can be used only with a valid ViewGroup root and
    attachToRoot=true
    - worked with getLayoutInflater</p>
  </blockquote>