Inflate a view / layout into another layout?
<p>I'm looking for a way to inflate another layout into the first layout in android. How would one do this? Here are the two XML files. The first is the main layout, the second is the layout I would like to inflate into the first.</p>

<p>I can't just include the layout as I will use this method to inflate other layouts into wire frames later on.</p>

<p>Code also at: <a href="http://pastebin.com/wjZ4s1cs" rel="nofollow">http://pastebin.com/wjZ4s1cs</a> as stackoverflow does not like XML.</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#ff000000"
    &gt;
    &lt;TextView
        android:id="@+id/headerMenuText"
        android:text="@string/main_menu_title"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:textSize="16pt"
        android:paddingTop="10px"
        android:paddingBottom="10px"
        android:gravity="center"
    &gt;
    &lt;/TextView&gt;
    &lt;TableLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_y="100dip"
        android:gravity="center"
        android:layout_gravity="center"
    &gt;
        &lt;TableRow
            android:gravity="center"
            android:layout_gravity="center"&gt;
            &lt;ImageView
                android:id="@+id/menuItem1"
                android:layout_height="101dip"
                android:layout_width="89dip"
                android:src="@drawable/icon_settings"
            &gt;&lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/menuItem2"
                android:layout_height="101dip"
                android:layout_width="89dip"
                android:src="@drawable/icon_system_restart"
            &gt;&lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/menuItem3"
                android:layout_height="101dip"
                android:layout_width="89dip"
                android:src="@drawable/icon_game_history"
            &gt;&lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/menuItem4"
                android:layout_height="101dip"
                android:layout_width="89dip"
                android:src="@drawable/icon_game_correction"
            &gt;&lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/menuItem5"
                android:layout_height="101dip"
                android:layout_width="89dip"
                android:src="@drawable/icon_game_other"
            &gt;&lt;/ImageView&gt;
        &lt;/TableRow&gt;

        &lt;TableRow android:gravity="center"&gt;
            &lt;TextView
                android:id="@+id/menuItemText1"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="@string/main_menu_item_text_1"
                android:layout_gravity="center"
                android:gravity="center"
            &gt;&lt;/TextView&gt;

            &lt;TextView
                android:id="@+id/menuItemText2"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="@string/main_menu_item_text_2"
                android:layout_gravity="center"
                android:gravity="center"
            &gt;&lt;/TextView&gt;

            &lt;TextView
                android:id="@+id/menuItemText3"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="@string/main_menu_item_text_3"
                android:layout_gravity="center"
                android:gravity="center"
            &gt;&lt;/TextView&gt;

            &lt;TextView
                android:id="@+id/menuItemText4"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="@string/main_menu_item_text_4"
                android:layout_gravity="center"
                android:gravity="center"
            &gt;&lt;/TextView&gt;

            &lt;TextView
                android:id="@+id/menuItemText5"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="@string/main_menu_item_text_5"
                android:layout_gravity="center"
                android:gravity="center"
            &gt;&lt;/TextView&gt;

        &lt;/TableRow&gt;
    &lt;/TableLayout&gt;
    &lt;View or layout
        android:id="@+id/screen_layout_bottom_menu"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    &gt;
    &lt;/View or layout&gt;
&lt;/AbsoluteLayout&gt;
</code></pre>

<p>Second layout</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/screen_bottom_menu"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    &gt;
    &lt;TableLayout
        android:id="@+id/screen_bottom_menu_table"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
    &gt;
        &lt;TableRow&gt;
            &lt;ImageView
                android:id="@+id/screen_bottom_menu_button_back"
                android:src="@drawable/back"&gt;
            &lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/screen_bottom_menu_button_ok"
                android:src="@drawable/checkmark"&gt;
            &lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/screen_bottom_menu_button_cancel"
                android:src="@drawable/xmark"&gt;
            &lt;/ImageView&gt;

            &lt;ImageView
                android:id="@+id/screen_bottom_menu_button_key_toggle"
                android:src="@drawable/lock"&gt;
            &lt;/ImageView&gt;
        &lt;/TableRow&gt;
    &lt;/TableLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>
