I am trying to configure the tab host as a layout element. All the examples I've seen display TabHost on their own in the view. The examples work fine, but when I try to make it part of another layout, it doesn't seem to work. I never found the documentation pointing anyway.
Something like this works (not all code is shown for illustration):
<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 does not work:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android">
Am I doing something wrong or is it simply impossible?
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 anything you need to install there?
When I say that this does not work, I mean that after starting the application in the emulator I get a pop-up message: "The application xxx (process com.example) stopped unexpectedly. Try again."
, . android 1.6, .