English | Site Directory

Android - An Open Handset Alliance Project

android.widget
public class

android.widget.TabHost

java.lang.Object
android.view.View Drawable.Callback KeyEvent.Callback
android.view.ViewGroup ViewManager ViewParent
android.widget.FrameLayout
android.widget.TabHost

Container for a tabbed window view. This object holds two children: a set of tab labels that the user clicks to select a specific tab, and a FrameLayout object that displays the contents of that page. The individual elements are typically controlled using this container object, rather than setting values on the child elements themselves.

Also see ViewGroup.LayoutParams for layout attributes.

Nested Classes
TabHost.OnTabChangeListener Interface definition for a callback to be invoked when tab changed  
TabHost.TabContentFactory Makes the content of a tab when it is selected. 
TabHost.TabSpec A tab has a tab indictor, content, and a tag that is used to keep track of it. 

Summary

XML Attributes inherited from class android.widget.FrameLayout
XML Attributes inherited from class android.view.ViewGroup
XML Attributes inherited from class android.view.View
Constants inherited from class android.view.ViewGroup
Constants inherited from class android.view.View

Fields

protected      int  mCurrentTab   
protected      LocalActivityManager  mLocalActivityManager   
Fields inherited from class android.widget.FrameLayout
Fields inherited from class android.view.ViewGroup
Fields inherited from class android.view.View

Public Constructors

          TabHost(Context context)
          TabHost(Context context, AttributeSet attrs, Map inflateParams)

Public Methods

        void  addTab(TabSpec tabSpec)
        void  clearAllTabs(boolean clearContent)
Removes all tabs from the tab widget associated with this tab host.
        boolean  dispatchUnhandledMove(View focused, int direction)
This method is the last chance for the focused view and its ancestors to respond to an arrow key.
        int  getCurrentTab()
        String  getCurrentTabTag()
        View  getCurrentTabView()
        View  getCurrentView()
        FrameLayout  getTabContentView()
Get the FrameLayout which holds tab content
        TabWidget  getTabWidget()
        TabSpec  newTabSpec(String tag)
Get a new TabHost.TabSpec associated with this tab host.
        void  setCurrentTab(int index)
        void  setCurrentTabByTag(String tag)
        void  setOnTabChangedListener(OnTabChangeListener l)
Register a callback to be invoked when the selected state of any of the items in this list changes
        void  setup()

Call setup() before adding tabs if loading TabHost using findViewById().

        void  setup(LocalActivityManager activityGroup)
Methods inherited from class android.widget.FrameLayout
Methods inherited from class android.view.ViewGroup