Hey,
I'm trying to set up a tab host as an element of a layout. All the examples I've seen show the TabHost by itself in the view. The examples work fine, but when trying to make it part of another layout it doesn't seem to work. I haven't found any documentation specifying one way or another.
Something like this works (Not all code shown for illustration purposes):
<TabHost>
<LinearLayout>
<TabWidget/>
<FrameLayout>
<TextView
android:text="this is a tab" />
<TextView
android:text="this is another tab" />
<TextView
android:text="this is a third tab" />
</FrameLayout>
</LinearLayout>
</TabHost>
However this doesn't work:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
Am I doing something wrong or is this just not possible ?
This is my onCreate method:
public class MyActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Is there something that needs to be set there ?
When I say it doesn't work I mean that after running the application on the emulator I get a popup saying: "The application xxx (process com.example) has stopped unexpectedly. Please try again."
If I remove the tab code it works again. I'm developing for android 1.6 if that makes a difference.