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

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  class ProcessLifecycleOwner : LifecycleOwner
  ```

*** ** * ** ***

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/kotlin/androidx/lifecycle/Lifecycle.Event#ON_CREATE` will be dispatched once and `https://developer.android.com/reference/kotlin/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/kotlin/androidx/lifecycle/Lifecycle.Event#ON_START`, `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event#ON_RESUME` events, as a first activity moves through these events. `https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event#ON_PAUSE`, `https://developer.android.com/reference/kotlin/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 companion functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner` | `https://developer.android.com/reference/kotlin/androidx/lifecycle/ProcessLifecycleOwner#get()()` The LifecycleOwner for the whole application process. | android |

| ### Public properties |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle` | `https://developer.android.com/reference/kotlin/androidx/lifecycle/ProcessLifecycleOwner#lifecycle()` | android |

## Public companion functions

### get

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

```
fun get(): LifecycleOwner
```

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/kotlin/androidx/lifecycle/LifecycleOwner` | `https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner` for the whole application. |

## Public properties

### lifecycle

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

```
open val lifecycle: Lifecycle
```