FragmentManager.FragmentLifecycleCallbacks

public abstract class FragmentManager.FragmentLifecycleCallbacks


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

Summary

Public methods

@NonNull 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.

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

Called after the fragment has been attached to its host.

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

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

@NonNull void

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

@NonNull void

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

@NonNull void

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

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

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

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

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

@NonNull void

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

@NonNull void

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

@NonNull void

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

@NonNull void

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

@NonNull void
onFragmentViewCreated(
    @NonNull FragmentManager fm,
    @NonNull Fragment f,
    @NonNull View v,
    @Nullable Bundle savedInstanceState
)

Called after the fragment has returned a non-null view from the FragmentManager's request to onCreateView.

@NonNull void

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

Public methods

onFragmentActivityCreated

@NonNull
public void onFragmentActivityCreated(
    @NonNull FragmentManager fm,
&n