# 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)

*** ** * ** ***


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

<br />

*** ** * ** ***

> [!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/androidx/lifecycle/DefaultLifecycleObserver` or `https://developer.android.com/reference/androidx/lifecycle/LifecycleEventObserver` instead.

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

## Summary

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

## Public methods

### value

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)

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

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