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

FragmentContainer

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

abstract class FragmentContainer

Known direct subclasses
FragmentHostCallback

Integration points with the Fragment host.


Callbacks to a Fragment's container.

Summary

Public constructors

Public functions

Fragment
instantiate(context: Context, className: String, arguments: Bundle?)

This function is deprecated.

Use FragmentManager#setFragmentFactory to control how Fragments are instantiated.

abstract View?

Return the view with the given resource ID.

abstract Boolean

Return {@code true} if the container holds any view.

Public constructors

FragmentContainer

FragmentContainer()

Public functions

instantiate

fun instantiate(context: Context, className: String, arguments: Bundle?): Fragment

Creates an instance of the specified fragment, can be overridden to construct fragments with dependencies, or change the fragment being constructed. By default just calls Fragment#instantiate(Context, String, Bundle).

onFindViewById

abstract fun onFindViewById(id: Int): View?

Return the view with the given resource ID. May return {@code null} if the view is not a child of this container.

onHasView

abstract fun onHasView(): Boolean

Return {@code true} if the container holds any view.