Interface FragmentLifecycleCallbacks


public interface FragmentLifecycleCallbacks
Callback interface for listening to fragment state changes that happen within a given FragmentManager.
  • Method Details

    • onFragmentPreAttached

      default void onFragmentPreAttached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called right before the fragment's Fragment.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 FragmentManager
      f - Fragment changing state
    • onFragmentAttached

      default void onFragmentAttached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has been attached to its host. Its host will have had onAttachFragment called before this call happens.
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentPreCreated

      default void onFragmentPreCreated(@Nonnull FragmentManager fm, @Nonnull Fragment f, @Nullable DataSet savedInstanceState)
      Called right before the fragment's Fragment.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 FragmentManager
      f - Fragment changing state
      savedInstanceState - 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 to Fragment.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 FragmentManager
      f - Fragment changing state
      savedInstanceState - 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 to Fragment.onCreateView(icyllis.modernui.view.LayoutInflater, ViewGroup, DataSet).
      Parameters:
      fm - Host FragmentManager
      f - Fragment that created and owns the view
      v - View returned by the fragment
      savedInstanceState - Saved instance bundle from a previous instance
    • onFragmentStarted

      default void onFragmentStarted(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onStart().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentResumed

      default void onFragmentResumed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onResume().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentPaused

      default void onFragmentPaused(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onPause().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentStopped

      default void onFragmentStopped(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onStop().
      Parameters:
      fm - Host FragmentManager
      f - 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 to Fragment.onSaveInstanceState(DataSet).
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
      outState - Saved state bundle for the fragment
    • onFragmentViewDestroyed

      default void onFragmentViewDestroyed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onDestroyView().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentDestroyed

      default void onFragmentDestroyed(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onDestroy().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state
    • onFragmentDetached

      default void onFragmentDetached(@Nonnull FragmentManager fm, @Nonnull Fragment f)
      Called after the fragment has returned from the FragmentManager's call to Fragment.onDetach().
      Parameters:
      fm - Host FragmentManager
      f - Fragment changing state