Interface Lifecycle


  • public interface Lifecycle
    An interface for listening to Activity/Fragment lifecycle events.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addListener​(LifecycleListener listener)
      Adds the given listener to the set of listeners managed by this Lifecycle implementation.
      void removeListener​(LifecycleListener listener)
      Removes the given listener from the set of listeners managed by this Lifecycle implementation, returning true if the listener was removed successfully, and false otherwise.
    • Method Detail

      • addListener

        void addListener​(@NonNull
                         LifecycleListener listener)
        Adds the given listener to the set of listeners managed by this Lifecycle implementation.
      • removeListener

        void removeListener​(@NonNull
                            LifecycleListener listener)
        Removes the given listener from the set of listeners managed by this Lifecycle implementation, returning true if the listener was removed successfully, and false otherwise.

        This is an optimization only, there is no guarantee that every added listener will eventually be removed.