Register now for Android Dev Summit 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

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.

abstract Boolean

Return true if the container holds any view.

Public constructors

<init>

FragmentContainer()

Callbacks to a Fragment's container.

Public methods

instantiate

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

Deprecated: Use FragmentManager#setFragmentFactory to control how Fragments are instantiated.

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.

onHasView

abstract fun onHasView(): Boolean

Return true if the container holds any view.