# AmbientLifecycleObserver

# AmbientLifecycleObserver

Artifact:[androidx.wear:wear](https://developer.android.com/jetpack/androidx/releases/wear)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/ambient/AmbientLifecycleObserver.kt+class:androidx.wear.ambient.AmbientLifecycleObserver)  
Added in[1.3.0](https://developer.android.com/jetpack/androidx/releases/wear#1.3.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/ambient/AmbientLifecycleObserver "View this page in Java")

<br />

```
interface AmbientLifecycleObserver : DefaultLifecycleObserver
```

<br />

*** ** * ** ***

Interface for LifecycleObservers which are used to add ambient mode support to activities on Wearable devices.

This interface can be implemented, or faked out, to allow for testing activities which use ambient support.

## Summary

|                                                                                                                                                                                                                                  ### Nested types                                                                                                                                                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[AmbientLifecycleObserver.AmbientDetails](https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientLifecycleObserver.AmbientDetails) Details about ambient mode support on the current device, passed to[AmbientLifecycleCallback.onEnterAmbient](https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientLifecycleObserver.AmbientLifecycleCallback#onEnterAmbient(androidx.wear.ambient.AmbientLifecycleObserver.AmbientDetails)). |
| `interface `[AmbientLifecycleObserver.AmbientLifecycleCallback](https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientLifecycleObserver.AmbientLifecycleCallback) Callback to receive ambient mode state changes.                                                                                                                                                                                                                                             |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isAmbient](https://developer.android.com/reference/kotlin/androidx/wear/ambient/AmbientLifecycleObserver#isAmbient()) |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.lifecycle.DefaultLifecycleObserver](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver) |--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onCreate](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onCreate(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)`   | | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onDestroy](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onDestroy(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)` | | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onPause](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onPause(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)`     | | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onResume](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onResume(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)`   | | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onStart](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onStart(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)`     | | `open `[Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onStop](https://developer.android.com/reference/kotlin/androidx/lifecycle/DefaultLifecycleObserver#onStop(androidx.lifecycle.LifecycleOwner))`(owner: `[LifecycleOwner](https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner)`)`       | |

## Public properties

### isAmbient

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

```
val isAmbient: Boolean
```  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|-------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | {@code true} if the activity is currently in ambient. |