# ExerciseState

Artifact: [androidx.health:health-services-client](https://developer.android.com/jetpack/androidx/releases/health) [View Source](https://cs.android.com/search?q=file:androidx/health/services/client/data/ExerciseState.kt+class:androidx.health.services.client.data.ExerciseState) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***


```
public final class ExerciseState
```

<br />

*** ** * ** ***

The state of an exercise.

## Summary

| ### Public fields |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ACTIVE()` The exercise is actively in-progress. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#AUTO_PAUSED()` The session has been automatically paused. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#AUTO_PAUSING()` The session is being paused by auto-pause. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#AUTO_RESUMING()` The session is being automatically resumed. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDED()` The exercise has been ended, with the reason specified by `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseStateInfo#endReason()`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#ENDING()` The exercise is currently ending, with the reason specified by `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseStateInfo#endReason()`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#PREPARING()` The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the `https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_PAUSED()` The session has been paused by the user. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_PAUSING()` The session is being paused by the user. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_RESUMING()` The session is being resumed by the user. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#USER_STARTING()` The exercise is actively being started, but we don't yet have sensor stability or GPS fix. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `static final https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#fromId(kotlin.Int)(int id)` Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` object corresponding to `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState.Companion#fromId(kotlin.Int)` or `null` if none match. |
| `final int` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#getId()()` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#getName()()` |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#hashCode()()` |
| `final boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isEnded()()` Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the ended states and false otherwise. |
| `final boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isEnding()()` Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the ending states and false otherwise. |
| `final boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isPaused()()` Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the paused states and false otherwise. |
| `final boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isResuming()()` Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the resuming states and false otherwise. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#toString()()` |

## Public fields

### ACTIVE

```
public static final @NonNull ExerciseState ACTIVE
```

The exercise is actively in-progress.

Used in both of the manually started exercise and the automatic exercise detection. It's also the state when the automatic exercise detection has detected an exercise and the exercise is actively in-progress.

### AUTO_PAUSED

```
public static final @NonNull ExerciseState AUTO_PAUSED
```

The session has been automatically paused. Sensors have completed flushing.

Used only in the manually started exercise.

### AUTO_PAUSING

```
public static final @NonNull ExerciseState AUTO_PAUSING
```

The session is being paused by auto-pause. Sensors are actively being flushed.

Used only in the manually started exercise.

### AUTO_RESUMING

```
public static final @NonNull ExerciseState AUTO_RESUMING
```

The session is being automatically resumed.

Used only in the manually started exercise.

### ENDED

```
public static final @NonNull ExerciseState ENDED
```

The exercise has been ended, with the reason specified by `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseStateInfo#endReason()`.

### ENDING

```
public static final @NonNull ExerciseState ENDING
```

The exercise is currently ending, with the reason specified by `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseStateInfo#endReason()`.

### PREPARING

```
public static final @NonNull ExerciseState PREPARING
```

The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the `https://developer.android.com/reference/androidx/health/services/client/data/WarmUpConfig`.

### USER_PAUSED

```
public static final @NonNull ExerciseState USER_PAUSED
```

The session has been paused by the user. Sensors have completed flushing.

Used only in the manually started exercise.

### USER_PAUSING

```
public static final @NonNull ExerciseState USER_PAUSING
```

The session is being paused by the user. Sensors are actively being flushed.

Used only in the manually started exercise.

### USER_RESUMING

```
public static final @NonNull ExerciseState USER_RESUMING
```

The session is being resumed by the user.

Used only in the manually started exercise.

### USER_STARTING

```
public static final @NonNull ExerciseState USER_STARTING
```

The exercise is actively being started, but we don't yet have sensor stability or GPS fix.

Used only in the manually started exercise.

## Public methods

### equals

```
public boolean equals(Object other)
```

### fromId

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

```
public static final ExerciseState fromId(int id)
```

Returns the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` object corresponding to `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState.Companion#fromId(kotlin.Int)` or `null` if none match.

| Parameters |
|---|---|
| `int id` | the `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#id()` to match against |

### getId

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

```
public final int getId()
```

### getName

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

```
public final @NonNull String getName()
```

### hashCode

```
public int hashCode()
```

### isEnded

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

```
public final boolean isEnded()
```

Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the ended states and false otherwise. This method returns false if the exercise has been paused, to check whether it is currently paused call `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isPaused()`.

### isEnding

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

```
public final boolean isEnding()
```

Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the ending states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isEnded()`.

### isPaused

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

```
public final boolean isPaused()
```

Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the paused states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isEnded()`.

### isResuming

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

```
public final boolean isResuming()
```

Returns true if this `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState` corresponds to one of the resuming states and false otherwise. This method returns false if the exercise has ended, to check whether it has ended call `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState#isEnded()`.

### toString

```
public @NonNull String toString()
```