Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

FragmentContainer

abstract class FragmentContainer
kotlin.Any
   ↳ androidx.fragment.app.FragmentContainer

Callbacks to a Fragment's container.

Summary

Public constructors

Callbacks to a Fragment's container.

Public methods
abstract Boolean

Return true if the container holds any view.

open Fragment
instantiate(@NonNull context: Context, @NonNull className: String, @Nullable arguments: Bundle?)

Creates an instance of the specified fragment, can be overridden to construct fragments with dependencies, or change the fragment being constructed.

abstract View?
onFindViewById(@IdRes id: Int)

Return the view with the given resource ID.

Public constructors

<init>

FragmentContainer()

Callbacks to a Fragment's container.

Public methods

onHasView

abstract fun onHasView(): Boolean

Return true if the container holds any view.

instantiate

@NonNull open fun instantiate(@NonNull context: Context, @NonNull className: String, @Nullable 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

@Nullable abstract fun onFindViewById(@IdRes id: Int): View?

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