Android Tabbed Layout setContent
<p>I'm developing an Android application with a tabbed layout. I've got it to where it doesn't spawn a new activity like <a href="http://developer.android.com/resources/tutorials/views/hello-tabwidget.html" rel="nofollow">Google's tutorial suggested</a>, however I only did this in an effort to get my content to show when clicking on each tab. Currently it just shows black regardless of what tab is active.</p>

<p>The following is my code in its latest iteration:</p>

<p><strong>Main.java</strong></p>

<pre><code>public class Main extends TabActivity {
    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Resources res = getResources();
        TabHost tabHost = getTabHost();
        TabHost.TabSpec spec;

        // add orders tab
        spec = tabHost.newTabSpec("orders").setIndicator("Orders",
                          res.getDrawable(R.drawable.flash_36))
                          .setContent(R.id.ordersLayout);
        tabHost.addTab(spec);

        // add positions tab
        spec = tabHost.newTabSpec("positions").setIndicator("Positions",
                          res.getDrawable(R.drawable.small_tiles_36))
                          .setContent(R.id.positionsLayout);
        tabHost.addTab(spec);

        // add strategies tab
        spec = tabHost.newTabSpec("strategies").setIndicator("Strategies",
                          res.getDrawable(R.drawable.cards_36))
                          .setContent(R.id.strategiesLayout);
        tabHost.addTab(spec);

        // add account tab
        spec = tabHost.newTabSpec("account").setIndicator("Account",
                          res.getDrawable(R.drawable.seal_36))
                          .setContent(R.id.accountLayout);
        tabHost.addTab(spec);

        tabHost.setCurrentTab(1);
    }

}
</code></pre>

<p><strong>Main.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;


&lt;TabHost    android:id="@android:id/tabhost" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            xmlns:android="http://schemas.android.com/apk/res/android"&gt;

            &lt;LinearLayout   android:id="@+id/mainLayout" 
                            android:layout_width="fill_parent" 
                            android:layout_height="fill_parent"
                            android:padding="5dp"&gt;

                &lt;TabWidget  android:id="@android:id/tabs" 
                            android:layout_width="fill_parent" 
                            android:layout_height="wrap_content"&gt;
                &lt;/TabWidget&gt;

                &lt;FrameLayout android:id="@android:id/tabcontent" 
                            android:layout_width="fill_parent" 
                            android:layout_height="fill_parent"
                            android:background="#fff"
                            android:padding="5dp"&gt;

                            &lt;include layout="@layout/orders"/&gt;
                            &lt;include layout="@layout/positions"/&gt;
                            &lt;include layout="@layout/strategies"/&gt;
                            &lt;include layout="@layout/account"/&gt;

                &lt;/FrameLayout&gt;

            &lt;/LinearLayout&gt;

&lt;/TabHost&gt;
</code></pre>

<p><strong>Account.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;LinearLayout 
    android:id="@+id/accountLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#fff"
    xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;TextView 
        android:text="Account Information" 
        android:id="@+id/accountLabel" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"&gt;

    &lt;/TextView&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p><strong>Orders.xml</strong></p>

<p><em>I'm only including these two, they are all the exact same with appropriate ids for the LinearLayout's android:id parameter.</em></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;LinearLayout 
    android:id="@+id/ordersLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#fff"
    xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;TextView 
        android:text="Working Orders" 
        android:id="@+id/ordersLabel" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"&gt;

    &lt;/TextView&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>And here's a screenshot of what I get when switching between tabs:</p>

<p><strong>Orders Tab</strong></p>

<p><img src="http://i.stack.imgur.com/NVq2e.png" alt="alt text"></p>

<p><strong>Positions Tab</strong></p>

<p><img src="http://i.stack.imgur.com/b7OQj.png" alt="alt text"></p>

<p>This is true for both the emulator and a Samsung Galaxy I just got, and I highly reccommend by the way, any ideas?</p>
