Lifecycle.Event



Summary

Enum Values

ON_ANY

An Event constant that can be used to match all events.

ON_CREATE

Constant for onCreate event of the LifecycleOwner.

ON_DESTROY

Constant for onDestroy event of the LifecycleOwner.

ON_PAUSE

Constant for onPause event of the LifecycleOwner.

ON_RESUME

Constant for onResume event of the LifecycleOwner.

ON_START

Constant for onStart event of the LifecycleOwner.

ON_STOP

Constant for onStop event of the LifecycleOwner.

Public companion functions

Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle leaving the specified Lifecycle.State to a lower state, or null if there is no valid event that can move down from the given state.

Cmn
Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle entering the specified Lifecycle.State from a higher state, or null if there is no valid event that can move down to the given state.

Cmn
Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle leaving the specified Lifecycle.State to a higher state, or null if there is no valid event that can move up from the given state.

Cmn
Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle entering the specified Lifecycle.State from a lower state, or null if there is no valid event that can move up to the given state.

Cmn

Public functions

Lifecycle.Event
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Cmn
Array<Lifecycle.Event>

Returns an array containing the constants of this enum type, in the order they're declared.

Cmn

Public properties

EnumEntries<Lifecycle.Event>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Cmn
Lifecycle.State

Returns the new Lifecycle.State of a Lifecycle that just reported this Lifecycle.Event.

Cmn

Enum Values

ON_ANY

val Lifecycle.Event.ON_ANYLifecycle.Event

An Event constant that can be used to match all events.

ON_CREATE

val Lifecycle.Event.ON_CREATELifecycle.Event

Constant for onCreate event of the LifecycleOwner.

ON_DESTROY

val Lifecycle.Event.ON_DESTROYLifecycle.Event

Constant for onDestroy event of the LifecycleOwner.

ON_PAUSE

val Lifecycle.Event.ON_PAUSELifecycle.Event

Constant for onPause event of the LifecycleOwner.

ON_RESUME

val Lifecycle.Event.ON_RESUMELifecycle.Event

Constant for onResume event of the LifecycleOwner.

ON_START

val Lifecycle.Event.ON_STARTLifecycle.Event

Constant for onStart event of the LifecycleOwner.

ON_STOP

val Lifecycle.Event.ON_STOPLifecycle.Event

Constant for onStop event of the LifecycleOwner.

Public companion functions

downFrom

fun downFrom(state: Lifecycle.State): Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle leaving the specified Lifecycle.State to a lower state, or null if there is no valid event that can move down from the given state.

Parameters
state: Lifecycle.State

the higher state that the returned event will transition down from

Returns
Lifecycle.Event?

the event moving down the lifecycle phases from state

downTo

fun downTo(state: Lifecycle.State): Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle entering the specified Lifecycle.State from a higher state, or null if there is no valid event that can move down to the given state.

Parameters
state: Lifecycle.State

the lower state that the returned event will transition down to

Returns
Lifecycle.Event?

the event moving down the lifecycle phases to state

upFrom

fun upFrom(state: Lifecycle.State): Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle leaving the specified Lifecycle.State to a higher state, or null if there is no valid event that can move up from the given state.

Parameters
state: Lifecycle.State

the lower state that the returned event will transition up from

Returns
Lifecycle.Event?

the event moving up the lifecycle phases from state

upTo

fun upTo(state: Lifecycle.State): Lifecycle.Event?

Returns the Lifecycle.Event that will be reported by a Lifecycle entering the specified Lifecycle.State from a lower state, or null if there is no valid event that can move up to the given state.

Parameters
state: Lifecycle.State

the higher state that the returned event will transition up to

Returns
Lifecycle.Event?

the event moving up the lifecycle phases to state

Public functions

valueOf

fun valueOf(value: String): Lifecycle.Event

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<Lifecycle.Event>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

Public properties

entries

val entriesEnumEntries<Lifecycle.Event>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.

targetState

val targetStateLifecycle.State

Returns the new Lifecycle.State of a Lifecycle that just reported this Lifecycle.Event.

Throws IllegalArgumentException if called on .ON_ANY, as it is a special value used by OnLifecycleEvent and not a real lifecycle event.

Returns
Lifecycle.State

the state that will result from this event