The Android Developer Challenge is back! Submit your idea before December 2.

FragmentTabHost

public class FragmentTabHost
extends TabHost implements TabHost.OnTabChangeListener

java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ android.widget.TabHost
           ↳ androidx.fragment.app.FragmentTabHost


This class is deprecated.
Use TabLayout and ViewPager instead.

Special TabHost that allows the use of Fragment objects for its tab content. When placing this in a view hierarchy, after inflating the hierarchy you must call setup(Context, FragmentManager, int) to complete the initialization of the tab host.

Summary

Inherited constants

Inherited fields

Public constructors

FragmentTabHost(Context context)

This constructor is deprecated. Use TabLayout and ViewPager instead.

FragmentTabHost(Context context, AttributeSet attrs)

This constructor is deprecated. Use TabLayout and ViewPager instead.

Public methods

void addTab(TabHost.TabSpec tabSpec, Class<?> clss, Bundle args)

This method is deprecated. Use TabLayout and ViewPager instead.

void onTabChanged(String tabId)

This method is deprecated. Use TabLayout and ViewPager instead.

void setOnTabChangedListener(TabHost.OnTabChangeListener l)

This method is deprecated. Use TabLayout and ViewPager instead.

void setup()

This method is deprecated. Use TabLayout and ViewPager instead.

void setup(Context context, FragmentManager manager, int containerId)

This method is deprecated. Use TabLayout and ViewPager instead.

void setup(Context context, FragmentManager manager)

This method is deprecated. Use TabLayout and ViewPager instead.

Protected methods

void onAttachedToWindow()

This method is deprecated. Use TabLayout and ViewPager instead.

void onDetachedFromWindow()

This method is deprecated. Use TabLayout and ViewPager instead.

void onRestoreInstanceState(Parcelable state)

This method is deprecated. Use TabLayout and ViewPager instead.

Parcelable onSaveInstanceState()

This method is deprecated. Use TabLayout and ViewPager instead.

Inherited methods

Public constructors

FragmentTabHost

public FragmentTabHost (Context context)

This constructor is deprecated.
Use TabLayout and ViewPager instead.

Parameters
context Context

FragmentTabHost

public FragmentTabHost (Context context, 
                AttributeSet attrs)

This constructor is deprecated.
Use TabLayout and ViewPager instead.

Parameters
context Context

attrs AttributeSet

Public methods

addTab

public void addTab (TabHost.TabSpec tabSpec, 
                Class<?> clss, 
                Bundle args)

This method is deprecated.
Use TabLayout and ViewPager instead.

Parameters
tabSpec TabHost.TabSpec

clss Class

args Bundle

onTabChanged

public void onTabChanged (String tabId)

This method is deprecated.
Use TabLayout and ViewPager instead.

Parameters
tabId String

setOnTabChangedListener

public void setOnTabChangedListener (TabHost.OnTabChangeListener l)

This method is deprecated.
Use TabLayout and ViewPager instead.

Parameters
l TabHost.OnTabChangeListener

setup

public void setup ()

This method is deprecated.
Use TabLayout and ViewPager instead.

setup

public void setup (Context context, 
                FragmentManager manager, 
                int containerId)

This method is deprecated.
Use TabLayout and ViewPager instead.

Set up the FragmentTabHost to use the given FragmentManager

Parameters
context Context

manager FragmentManager

containerId int

setup

public void setup (Context context, 
                FragmentManager manager)

This method is deprecated.
Use TabLayout and ViewPager instead.

Set up the FragmentTabHost to use the given FragmentManager

Parameters
context Context

manager FragmentManager

Protected methods

onAttachedToWindow

protected void onAttachedToWindow ()

This method is deprecated.
Use TabLayout and ViewPager instead.

onDetachedFromWindow

protected void onDetachedFromWindow ()

This method is deprecated.
Use TabLayout and ViewPager instead.

onRestoreInstanceState

protected void onRestoreInstanceState (Parcelable state)

This method is deprecated.
Use TabLayout and ViewPager instead.

Parameters
state Parcelable

onSaveInstanceState

protected Parcelable onSaveInstanceState ()

This method is deprecated.
Use TabLayout and ViewPager instead.

Returns
Parcelable