Package icyllis.modernui.lifecycle
Interface LifecycleObserver
public interface LifecycleObserver
Callback interface for listening to 
LifecycleOwner state changes.
 
 Methods like onCreate(LifecycleOwner) will be called first, and then
 followed by the call of onStateChanged(LifecycleOwner, Lifecycle.Event).
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidonCreate(LifecycleOwner owner) Notifies thatON_CREATEevent occurred.default voidonDestroy(LifecycleOwner owner) Notifies thatON_DESTROYevent occurred.default voidonPause(LifecycleOwner owner) Notifies thatON_PAUSEevent occurred.default voidonResume(LifecycleOwner owner) Notifies thatON_RESUMEevent occurred.default voidonStart(LifecycleOwner owner) Notifies thatON_STARTevent occurred.default voidonStateChanged(LifecycleOwner source, Lifecycle.Event event) Called when a state transition event happens.default voidonStop(LifecycleOwner owner) Notifies thatON_STOPevent occurred.
- 
Method Details- 
onCreateNotifies thatON_CREATEevent occurred.This method will be called after the LifecycleOwner'sonCreatemethod returns.- Parameters:
- owner- the component, whose state was changed
 
- 
onStartNotifies thatON_STARTevent occurred.This method will be called after the LifecycleOwner'sonStartmethod returns.- Parameters:
- owner- the component, whose state was changed
 
- 
onResumeNotifies thatON_RESUMEevent occurred.This method will be called after the LifecycleOwner'sonResumemethod returns.- Parameters:
- owner- the component, whose state was changed
 
- 
onPauseNotifies thatON_PAUSEevent occurred.This method will be called before the LifecycleOwner'sonPausemethod is called.- Parameters:
- owner- the component, whose state was changed
 
- 
onStopNotifies thatON_STOPevent occurred.This method will be called before the LifecycleOwner'sonStopmethod is called.- Parameters:
- owner- the component, whose state was changed
 
- 
onDestroyNotifies thatON_DESTROYevent occurred.This method will be called before the LifecycleOwner'sonStopmethod is called.- Parameters:
- owner- the component, whose state was changed
 
- 
onStateChangedCalled when a state transition event happens.- Parameters:
- source- The source of the event
- event- The event
 
 
-