Using Tabs with Views
<p>I have a little problem using Tabs with Views.
First I just copied the sample code where Tabs are used with activitys:</p>

<p>My LayoutFile looks like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;LinearLayout
        android:orientation="vertical"
        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;FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp" /&gt;
    &lt;/LinearLayout&gt;
&lt;/TabHost&gt;
</code></pre>

<p>And this is my Java-code:</p>

<pre><code>public class MyActivity extends TabActivity{
    public void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState)
        setContentView(R.layout.main);
        TabHost tH = getTabHost();

        Indent intent = new Intent().setClass(this, AnotherActivity.class);

        // Initialize a TabSpec for each tab and add it to the TabHost
        //TextView Test = new TextView(this);
        //Test.setText("test");

        tH.addTab(tH.newTabSpec("t1").setIndicator("Tab1").setContent(intent));
        tH.setCurrentTab(0);
    }
}
</code></pre>

<p>And this works as expected.
But when I uncomment the TextView-lines and call setContent(Test.getId()) instead of setContent(intent), the app crashes.
I also tried to create a textview in the layoutfile, and call setContent(R.id.test),
that also makes it crash.</p>

<p>So this is one problem.</p>

<p>The seccond point is. I do not want to use activitys, because i want to be able to call methods on those classes, which shall represent the Tab-content.
So my original idea is, to derive some classes from view. 1 for each tab, and pass their ids. But therefor the codesample above needs to work first.</p>

<p>greetings Uzaku</p>
