Package icyllis.modernui.fragment
Interface FragmentLifecycleCallbacks
public interface FragmentLifecycleCallbacks
Callback interface for listening to fragment state changes that happen
within a given FragmentManager.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Called after the fragment has been attached to its host.default void
onFragmentCreated
(FragmentManager fm, Fragment f, DataSet savedInstanceState) Called after the fragment has returned from the FragmentManager's call toFragment.onCreate(DataSet)
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onDestroy()
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onDetach()
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onPause()
.default void
Called right before the fragment'sFragment.onAttach(icyllis.modernui.core.Context)
method is called.default void
onFragmentPreCreated
(FragmentManager fm, Fragment f, DataSet savedInstanceState) Called right before the fragment'sFragment.onCreate(DataSet)
method is called.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onResume()
.default void
onFragmentSaveInstanceState
(FragmentManager fm, Fragment f, DataSet outState) Called after the fragment has returned from the FragmentManager's call toFragment.onSaveInstanceState(DataSet)
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onStart()
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onStop()
.default void
onFragmentViewCreated
(FragmentManager fm, Fragment f, View v, DataSet savedInstanceState) Called after the fragment has returned a non-null view from the FragmentManager's request toFragment.onCreateView(icyllis.modernui.view.LayoutInflater, ViewGroup, DataSet)
.default void
Called after the fragment has returned from the FragmentManager's call toFragment.onDestroyView()
.
-
Method Details
-
onFragmentPreAttached
Called right before the fragment'sFragment.onAttach(icyllis.modernui.core.Context)
method is called. This is a good time to inject any required dependencies or perform other configuration for the fragment before any of the fragment's lifecycle methods are invoked.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentAttached
Called after the fragment has been attached to its host. Its host will have hadonAttachFragment
called before this call happens.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentPreCreated
default void onFragmentPreCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nullable DataSet savedInstanceState) Called right before the fragment'sFragment.onCreate(DataSet)
method is called. This is a good time to inject any required dependencies or perform other configuration for the fragment.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing statesavedInstanceState
- Saved instance bundle from a previous instance
-
onFragmentCreated
default void onFragmentCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nullable DataSet savedInstanceState) Called after the fragment has returned from the FragmentManager's call toFragment.onCreate(DataSet)
. This will only happen once for any given fragment instance, though the fragment may be attached and detached multiple times.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing statesavedInstanceState
- Saved instance bundle from a previous instance
-
onFragmentViewCreated
default void onFragmentViewCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nonnull View v, @Nullable DataSet savedInstanceState) Called after the fragment has returned a non-null view from the FragmentManager's request toFragment.onCreateView(icyllis.modernui.view.LayoutInflater, ViewGroup, DataSet)
.- Parameters:
fm
- Host FragmentManagerf
- Fragment that created and owns the viewv
- View returned by the fragmentsavedInstanceState
- Saved instance bundle from a previous instance
-
onFragmentStarted
Called after the fragment has returned from the FragmentManager's call toFragment.onStart()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentResumed
Called after the fragment has returned from the FragmentManager's call toFragment.onResume()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentPaused
Called after the fragment has returned from the FragmentManager's call toFragment.onPause()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentStopped
Called after the fragment has returned from the FragmentManager's call toFragment.onStop()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentSaveInstanceState
default void onFragmentSaveInstanceState(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nonnull DataSet outState) Called after the fragment has returned from the FragmentManager's call toFragment.onSaveInstanceState(DataSet)
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing stateoutState
- Saved state bundle for the fragment
-
onFragmentViewDestroyed
Called after the fragment has returned from the FragmentManager's call toFragment.onDestroyView()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentDestroyed
Called after the fragment has returned from the FragmentManager's call toFragment.onDestroy()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-
onFragmentDetached
Called after the fragment has returned from the FragmentManager's call toFragment.onDetach()
.- Parameters:
fm
- Host FragmentManagerf
- Fragment changing state
-