# OnLifecycleEvent

Artifact: [androidx.lifecycle:lifecycle-common](https://developer.android.com/jetpack/androidx/releases/lifecycle) [View Source](https://cs.android.com/search?q=file:androidx/lifecycle/OnLifecycleEvent.java+class:androidx.lifecycle.OnLifecycleEvent) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.0.0) Deprecated in [2.4.0](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.4.0)

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  @Retention(value = RetentionPolicy.RUNTIME)
  @Target(value = ElementType.METHOD)
  annotation OnLifecycleEvent
  ```

*** ** * ** ***

> [!CAUTION]
> **This annotation is deprecated.**   
>
> This annotation required the usage of code generation or reflection, which should be avoided. Use `https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver` or `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleEventObserver` instead.

Annotation that can be used to mark methods on `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleObserver` implementations that should be invoked to handle lifecycle events.

## Summary

| ### Public functions |
|---|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event!` | `[value](https://developer.android.com/reference/kotlin/androidx/lifecycle/OnLifecycleEvent#value())()` **This function is deprecated.** Deprecated in Java | android |

## Public functions

### value

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.0.0) Deprecated in [2.4.0](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.4.0)

```
abstract fun [value](https://developer.android.com/reference/kotlin/androidx/lifecycle/OnLifecycleEvent#value())(): Lifecycle.Event!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java