Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Methods](https://developer.android.com/reference/com/google/wear/services/ambient/AmbientComponentState.ActivityStateRegistry#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/com/google/wear/services/ambient/AmbientComponentState.ActivityStateRegistry#inhmethods)

# AmbientComponentState.ActivityStateRegistry


`
public
static
final

class
AmbientComponentState.ActivityStateRegistry
`


`

extends Object


`

`


`

|---|---|
| java.lang.Object ||
| ↳ | com.google.wear.services.ambient.AmbientComponentState.ActivityStateRegistry |

<br />

*** ** * ** ***

A state registry specifically intended for app components that subscribe to the standard
Android lifecycle. Components provide the `https://developer.android.com/reference/com/google/wear/services/ambient/AmbientManager` with their lifecycle updates
via the appropriate callbacks. The critical states for ambient mode correspond to the Android
lifecycle stats of RESUMED and PAUSED as it is only between these two states that a component
is eligible for ambient display.

Apps can provide this integration following this example:

```
     @Override
     void onCreate() {
         mMyActivityStateRegistry = AmbientComponentState.makeActivityRegistry();
     }

     @Override
     void onResume() {
         mMyActivityStateRegistry.onResume();
     }

     @Override
     void onPause() {
         mMyActivityStateRegistry.onPause();
     }

 
```

<br />

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/ambient/AmbientComponentState.ActivityStateRegistry#onPause()() ` Indicate that this component is paused, thereby disabling eligibility for ambient events. |
| ` void` | ` https://developer.android.com/reference/com/google/wear/services/ambient/AmbientComponentState.ActivityStateRegistry#onResume()() ` Indicate that this component is resumed, thereby enabing eligibility for ambient events. |

| ### Inherited methods |
|---|---|
| From class ` java.lang.Object ` |---|---| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class<?>` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||

## Public methods

### onPause

Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onPause ()
```

Indicate that this component is paused, thereby disabling eligibility for ambient events.

<br />

### onResume

Added in [version 33.1](https://developer.android.com/topic/libraries/support-library/revisions)

```
public void onResume ()
```

Indicate that this component is resumed, thereby enabing eligibility for ambient events.

<br />