Android 12 Developer Preview is here! Try it out, and give us your feedback!

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