FragmentManager.FragmentLifecycleCallbacks

public abstract class FragmentManager.FragmentLifecycleCallbacks


Callback interface for listening to fragment state changes that happen within a given FragmentManager.

Summary

Public constructors

Public methods

void
onFragmentActivityCreated(
    @NonNull FragmentManager fm,
    @NonNull Fragment f,
    @Nullable Bundle savedInstanceState
)

This method is deprecated.

To get a callback specifically when a Fragment activity's onCreate is called, register a androidx.lifecycle.LifecycleObserver on the Activity's Lifecycle in onFragmentAttached, removing it when it receives the CREATED callback.

void
onFragmentAttached(
    @NonNull FragmentManager fm,
    @NonNull Fragment f,
    @NonNull Context context
)

Called after the fragment has been attached to its host.

void
onFragmentCreated(
    @NonNull FragmentManager fm,
    @NonNull Fragment f,
    @Nullable Bundle savedInstanceState
)

Called after the fragment has returned from the FragmentManager's call to onCreate.

void

Called after the fragment has returned from the FragmentManager's call to onDestroy.

void

Called after the fragment has returned from the FragmentManager's call to onDetach.

void

Called after the fragment has returned from the FragmentManager's call to onPause.

void
onFragmentPreAttached(
    @NonNull FragmentManager fm,
    @NonNull Fragment f,
    @NonNull Context context
)

Called right before the fragment's onAttach method is called.

void