Makes the content of a tab when it is selected. Use this if your tab content needs to be created on demand, i.e. you are not showing an existing view or starting an activity.
The view to display the contents of the selected tab.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TabHost.TabContentFactory\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTabContentFactory\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/TabHost.TabContentFactory \"View this page in Java\") \n\n```\ninterface TabContentFactory\n```\n\n|-----------------------------------------------|\n| [android.widget.TabHost.TabContentFactory](#) |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 30.**\n|\n| Deprecated in Java.\n\nMakes the content of a tab when it is selected. Use this if your tab content needs to be created on demand, i.e. you are not showing an existing view or starting an activity.\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [View](../view/View.html#)! | [createTabContent](#createTabContent(kotlin.String))`(`tag:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Callback to make the tab contents |\n\nPublic methods\n--------------\n\n### createTabContent\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun createTabContent(tag: String!): View!\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCallback to make the tab contents\n\n| Parameters ||\n|-------|------------------------------------------------------------------------------------------------------------|\n| `tag` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: Which tab was selected. |\n\n| Return ||\n|-----------------------------|-------------------------------------------------------|\n| [View](../view/View.html#)! | The view to display the contents of the selected tab. |"]]