{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

FragmentTabHost

{% setvar page_path %}androidx/fragment/app/FragmentTabHost.html{% endsetvar %} {% setvar can_switch %}1{% endsetvar %} {% include "reference/_kotlin_switcher2.md" %}

class 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 to complete the initialization of the tab host.

Summary

Public constructors

FragmentTabHost(context: Context)

This function is deprecated.

Use TabLayout and ViewPager instead.

FragmentTabHost(context: Context, attrs: AttributeSet?)

This function is deprecated.

Use TabLayout and ViewPager instead.

Public functions

Unit
addTab(tabSpec: TabSpec, clss: Class<Any>, args: Bundle?)

This function is deprecated.

Use TabLayout and ViewPager instead.

Unit

This function is deprecated.

Use TabLayout and ViewPager instead.

Unit
setOnTabChangedListener(l: OnTabChangeListener?)

This function is deprecated.

Use TabLayout and ViewPager instead.

Unit

This function is deprecated.

Use TabLayout and ViewPager instead.

Unit
setup(context: Context, manager: FragmentManager)

This function is deprecated.

Use TabLayout and ViewPager instead.

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

This function is deprecated.

Use TabLayout and ViewPager instead.

Public constructors

FragmentTabHost

FragmentTabHost(context: Context)

FragmentTabHost

FragmentTabHost(context: Context, attrs: AttributeSet?)

Public functions

addTab

fun addTab(tabSpec: TabSpec, clss: Class<Any>, args: Bundle?): Unit

onTabChanged

fun onTabChanged(tabId: String?): Unit

setOnTabChangedListener

fun setOnTabChangedListener(l: OnTabChangeListener?): Unit

setup

fun setup(): Unit

setup

fun setup(context: Context, manager: FragmentManager): Unit

Set up the FragmentTabHost to use the given FragmentManager

setup

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

Set up the FragmentTabHost to use the given FragmentManager