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

FragmentTabHost

open class FragmentTabHost : TabHost, OnTabChangeListener
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ android.widget.TabHost
   ↳ androidx.fragment.app.FragmentTabHost

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

Public constructors

<init>(@NonNull context: Context)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Public methods

open Unit
addTab(@NonNull tabSpec: TabSpec, @NonNull clss: Class<*>, @Nullable args: Bundle?)

open Unit
onTabChanged(@Nullable tabId: String?)

open Unit

open Unit

open Unit
setup(@NonNull context: Context, @NonNull manager: FragmentManager)

Set up the FragmentTabHost to use the given FragmentManager

open Unit
setup(@NonNull context: Context, @NonNull manager: FragmentManager, containerId: Int)

Set up the FragmentTabHost to use the given FragmentManager

Protected methods

open Unit

open Unit

open Unit

open Parcelable

Public constructors

<init>

FragmentTabHost(@NonNull context: Context)

Deprecated: Use TabLayout and ViewPager instead.

<init>

FragmentTabHost(@NonNull context: Context, @Nullable attrs: AttributeSet?)

Deprecated: Use TabLayout and ViewPager instead.

Public methods

addTab

open fun addTab(@NonNull tabSpec: TabSpec, @NonNull clss: Class<*>, @Nullable args: Bundle?): Unit

Deprecated: Use TabLayout and ViewPager instead.

onTabChanged

open fun onTabChanged(@Nullable tabId: String?): Unit

Deprecated: Use TabLayout and ViewPager instead.

setOnTabChangedListener

open fun setOnTabChangedListener(@Nullable l: OnTabChangeListener?): Unit

Deprecated: Use TabLayout and ViewPager instead.

setup

open fun setup(): Unit

Deprecated: Use TabLayout and ViewPager instead.

setup

open fun setup(@NonNull context: Context, @NonNull manager: FragmentManager): Unit

Deprecated: Use TabLayout and ViewPager instead.

Set up the FragmentTabHost to use the given FragmentManager

setup

open fun setup(@NonNull context: Context, @NonNull manager: FragmentManager, containerId: Int): Unit

Deprecated: Use TabLayout and ViewPager instead.

Set up the FragmentTabHost to use the given FragmentManager

Protected methods

onAttachedToWindow

protected open fun onAttachedToWindow(): Unit

Deprecated: Use TabLayout and ViewPager instead.

onDetachedFromWindow

protected open fun onDetachedFromWindow(): Unit

Deprecated: Use TabLayout and ViewPager instead.

onRestoreInstanceState

protected open fun onRestoreInstanceState(state: Parcelable!): Unit

Deprecated: Use TabLayout and ViewPager instead.

onSaveInstanceState

@NonNull protected open fun onSaveInstanceState(): Parcelable

Deprecated: Use TabLayout and ViewPager instead.