# AmbientModeSupport.AmbientCallback

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

*** ** * ** ***


```
public abstract class AmbientModeSupport.AmbientCallback
```

<br />

*** ** * ** ***

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

Callback to receive ambient mode state changes. It must be used by all users of AmbientModeSupport.

## Summary

| ### Public constructors |
|---|
| `[AmbientCallback](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#AmbientCallback())()` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `void` | `[onAmbientOffloadInvalidated](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onAmbientOffloadInvalidated())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onEnterAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onEnterAmbient(android.os.Bundle))(https://developer.android.com/reference/android/os/Bundle.html ambientDetails)` **This method is deprecated.** Deprecated in Java |
| `void` | `[onExitAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onExitAmbient())()` **This method is deprecated.** Deprecated in Java |
| `void` | `[onUpdateAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onUpdateAmbient())()` **This method is deprecated.** Deprecated in Java |

## Public constructors

### AmbientCallback

Added in 1.1.0 Deprecated in 1.3.0

```
public [AmbientCallback](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#AmbientCallback())()
```

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

## Public methods

### onAmbientOffloadInvalidated

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

```
public void [onAmbientOffloadInvalidated](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onAmbientOffloadInvalidated())()
```

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

Called to inform an activity that whatever decomposition it has sent to Sidekick is no longer valid and should be re-sent before enabling ambient offload.

### onEnterAmbient

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

```
public void [onEnterAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onEnterAmbient(android.os.Bundle))(Bundle ambientDetails)
```

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

Called when an activity is entering ambient mode. This event is sent while an activity is running (after onResume, before onPause). All drawing should complete by the conclusion of this method. Note that `invalidate()` calls will be executed before resuming lower-power mode.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html ambientDetails` | bundle containing information about the display being used. It includes information about low-bit color and burn-in protection. |

### onExitAmbient

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

```
public void [onExitAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onExitAmbient())()
```

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

Called when an activity should exit ambient mode. This event is sent while an activity is running (after onResume, before onPause).

### onUpdateAmbient

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

```
public void [onUpdateAmbient](https://developer.android.com/reference/androidx/wear/ambient/AmbientModeSupport.AmbientCallback#onUpdateAmbient())()
```

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

Called when the system is updating the display for ambient mode. Activities may use this opportunity to update or invalidate views.