Lifecycle.Event
-
Cmn
enum Lifecycle.Event : Enum
Summary
Enum Values |
|
|---|---|
ON_ANY |
An |
ON_CREATE |
Constant for onCreate event of the |
ON_DESTROY |
Constant for onDestroy event of the |
ON_PAUSE |
Constant for onPause event of the |
ON_RESUME |
Constant for onResume event of the |
ON_START |
Constant for onStart event of the |
ON_STOP |
Constant for onStop event of the |
Public companion functions |
||
|---|---|---|
Lifecycle.Event? |
downFrom(state: Lifecycle.State)Returns the |
Cmn
|
Lifecycle.Event? |
downTo(state: Lifecycle.State)Returns the |
Cmn
|
Lifecycle.Event? |
upFrom(state: Lifecycle.State)Returns the |
Cmn
|
Lifecycle.Event? |
upTo(state: Lifecycle.State)Returns the |
Cmn
|
Public functions |
||
|---|---|---|
Lifecycle.Event |
Returns the enum constant of this type with the specified name. |
Cmn
|
Array<Lifecycle.Event> |
values()Returns an array containing the constants of this enum type, in the order they're declared. |
Cmn
|
Public properties |
||
|---|---|---|
EnumEntries<Lifecycle.Event> |
Returns an immutable |
Cmn
|
Lifecycle.State |
Returns the new |
Cmn
|
Enum Values
ON_ANY
val Lifecycle.Event.ON_ANY: Lifecycle.Event
An Event constant that can be used to match all events.
ON_CREATE
val Lifecycle.Event.ON_CREATE: Lifecycle.Event
Constant for onCreate event of the LifecycleOwner.
ON_DESTROY
val Lifecycle.Event.ON_DESTROY: Lifecycle.Event
Constant for onDestroy event of the LifecycleOwner.
ON_PAUSE
val Lifecycle.Event.ON_PAUSE: Lifecycle.Event
Constant for onPause event of the LifecycleOwner.
ON_RESUME
val Lifecycle.Event.ON_RESUME: Lifecycle.Event
Constant for onResume event of the LifecycleOwner.
ON_START
val Lifecycle.Event.ON_START: Lifecycle.Event
Constant for onStart event of the LifecycleOwner.
ON_STOP
val Lifecycle.Event.ON_STOP: Lifecycle.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.
The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using entries property as a more efficient alternative returning an immutable list of enum entries.
Public properties
entries
val entries: EnumEntries<Lifecycle.Event>
Returns an immutable kotlin.enums.EnumEntries list containing the constants of this enum type, in the order they're declared.
targetState
val targetState: Lifecycle.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 androidx.lifecycle.OnLifecycleEvent and not a real lifecycle event.
| Returns | |
|---|---|
Lifecycle.State |
the state that will result from this event |