title: Using multiple layouts with include tag in Android
body: <p>I'm trying to create a title bar that is the same throughout my application and have been creating layouts like this for each of my activities:</p>
  
  <p>main.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
   &lt;include layout="@layout/title_bar_layout" android:id="@+id/title_bar_layout" /&gt;
   &lt;include layout="@layout/main_body" android:id="@+id/main_body" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>main_body.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@+id/main_table" android:layout_width="fill_parent"
   android:layout_height="fill_parent" android:stretchColumns="1"
   android:orientation="vertical"&gt;
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p>my onCreate contains:</p>
  
  <pre><code>setContentView(R.layout.main);
  TableLayout t = (TableLayout) findViewById(R.id.main_table);
  </code></pre>
  
  <p>but t always ends up null.</p>