Stay organized with collections
Save and categorize content based on your preferences.
FragmentContainer
abstract class FragmentContainer
Callbacks to a Fragment
's container.
Summary
Public methods |
abstract T? |
Return the view with the given resource ID.
|
abstract Boolean |
Return true if the container holds any view.
|
Public constructors
FragmentContainer
FragmentContainer()
Public methods
onFindViewById
abstract fun <T : View!> onFindViewById(id: Int): T?
Deprecated: Deprecated in Java.
Return the view with the given resource ID. May return null
if the view is not a child of this container.
onHasView
abstract fun onHasView(): Boolean
Deprecated: Deprecated in Java.
Return true
if the container holds any view.
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,["# FragmentContainer\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nFragmentContainer\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/FragmentContainer \"View this page in Java\") \n\n```\nabstract class FragmentContainer\n```\n\n|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.FragmentContainer](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [FragmentHostCallback](/reference/kotlin/android/app/FragmentHostCallback) |----------------------------------------------------------------------------|--------------------------------------------| | [FragmentHostCallback](/reference/kotlin/android/app/FragmentHostCallback) | Integration points with the Fragment host. | |\n\n*** ** * ** ***\n\n| **This class was deprecated in API level 28.**\n|\n| Use the [Support Library](https://developer.android.com/tools/extras/support-library.html) androidx.fragment.app.FragmentContainer.\n\nCallbacks to a [Fragment](/reference/kotlin/android/app/Fragment)'s container.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------|---|\n| [FragmentContainer](#FragmentContainer())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract T? | [onFindViewById](#onFindViewById(kotlin.Int))`(`id:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Return the view with the given resource ID. |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onHasView](#onHasView())`()` Return `true` if the container holds any view. |\n\nPublic constructors\n-------------------\n\n### FragmentContainer\n\n```\nFragmentContainer()\n```\n\nPublic methods\n--------------\n\n### onFindViewById\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun \u003cT : View!\u003e onFindViewById(id: Int): T?\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nReturn the view with the given resource ID. May return `null` if the view is not a child of this container. \n\n### onHasView\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onHasView(): Boolean\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nReturn `true` if the container holds any view."]]