# ProcessLifecycleOwner

Artifact: [androidx.lifecycle:lifecycle-process](https://developer.android.com/jetpack/androidx/releases/lifecycle) [View Source](https://cs.android.com/search?q=file:androidx/lifecycle/ProcessLifecycleOwner.kt+class:androidx.lifecycle.ProcessLifecycleOwner) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/lifecycle#2.0.0)

*** ** * ** ***


```
public final class ProcessLifecycleOwner implements LifecycleOwner
```

<br />

*** ** * ** ***

Class that provides lifecycle for the whole application process.

You can consider this LifecycleOwner as the composite of all of your Activities, except that `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_CREATE` will be dispatched once and `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_DESTROY` will never be dispatched. Other lifecycle events will be dispatched with following rules: ProcessLifecycleOwner will dispatch `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_START`, `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_RESUME` events, as a first activity moves through these events. `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_PAUSE`, `https://developer.android.com/reference/androidx/lifecycle/Lifecycle.Event#ON_STOP`, events will be dispatched with a **delay** after a last activity passed through them. This delay is long enough to guarantee that ProcessLifecycleOwner won't send any events if activities are destroyed and recreated due to a configuration change.

It is useful for use cases where you would like to react on your app coming to the foreground or going to the background and you don't need a milliseconds accuracy in receiving lifecycle events.

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` | `https://developer.android.com/reference/androidx/lifecycle/ProcessLifecycleOwner#get()()` The LifecycleOwner for the whole application process. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/Lifecycle` | `https://developer.android.com/reference/androidx/lifecycle/ProcessLifecycleOwner#getLifecycle()()` |

## Public methods

### get

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

```
public static final @NonNull LifecycleOwner get()
```

The LifecycleOwner for the whole application process. Note that if your application has multiple processes, this provider does not know about other processes.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` | `https://developer.android.com/reference/androidx/lifecycle/LifecycleOwner` for the whole application. |

### getLifecycle

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

```
public @NonNull Lifecycle getLifecycle()
```