In TabContet is where you define the root element of each tab.
there is an example using a Scrollview and a Relative layout for two tabs in tabcontent.
I suggest you use a Tabhost as parent to your tabwidget.
I don't see why not. TabHost is a regular view. As long as you don't need a (deprecated) TabActivity to show multiple activities as the tabs, you can add tabs using instances of the TabContentFactory interface.
A very simple example would be something like:
protected void onCreate(Bundle savedInstanceState)
TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);
for (int i = 0; i < 3; i++)
final String tabText = "Content of tab number " + i;
TabSpec spec = tabHost.newTabSpec("tab" + i);
spec.setIndicator("Tab number " + i);
public View createTabContent(String tag)
TextView tabContent = new TextView(MainActivity.this);
Other platforms use the bottom tab bar to switch between the app's
views. Per platform convention, Android's tabs for view control are
shown in action bars at the top of the screen instead. In addition,
Android apps may use a bottom bar to display actions on a split action
You should follow this guideline to create a consistent experience
with other apps on the Android platform and to avoid confusion between
actions and view switching on Android.