# ExerciseState

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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/health/services/client/data/ExerciseState "View this page in Java")

<br />

```
class ExerciseState
```

<br />

*** ** * ** ***

The state of an exercise.

## Summary

|                                            ### Public companion functions                                             |
|-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)`?` | [fromId](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#fromId(kotlin.Int))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the[ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)object corresponding to[id](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState.Companion#fromId(kotlin.Int))or`null`if none match. |

|                                          ### Public companion properties                                           |
|--------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [ACTIVE](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#ACTIVE()) The exercise is actively in-progress.                                                                                                                                                                                  |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [AUTO_PAUSED](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#AUTO_PAUSED()) The session has been automatically paused.                                                                                                                                                                   |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [AUTO_PAUSING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#AUTO_PAUSING()) The session is being paused by auto-pause.                                                                                                                                                                 |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [AUTO_RESUMING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#AUTO_RESUMING()) The session is being automatically resumed.                                                                                                                                                              |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [ENDED](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#ENDED()) The exercise has been ended, with the reason specified by[ExerciseStateInfo.endReason](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseStateInfo#endReason()).               |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [ENDING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#ENDING()) The exercise is currently ending, with the reason specified by[ExerciseStateInfo.endReason](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseStateInfo#endReason()).        |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [PREPARING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#PREPARING()) The exercise is being prepared, GPS and HeartRate sensors will be turned on if requested in the[WarmUpConfig](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/WarmUpConfig). |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [USER_PAUSED](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#USER_PAUSED()) The session has been paused by the user.                                                                                                                                                                     |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [USER_PAUSING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#USER_PAUSING()) The session is being paused by the user.                                                                                                                                                                   |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [USER_RESUMING](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#USER_RESUMING()) The session is being resumed by the user.                                                                                                                                                                |
| [ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState) | [USER_STARTING](https://developer.android.com/reference/kotlin/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 functions                                         |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#toString())`()`                                                                                            |

|                                ### Public properties                                |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)         | [id](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#id())                                                                                                                                                                                                                      |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isEnded](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnded()) Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)corresponds to one of the ended states and false otherwise.          |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isEnding](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnding()) Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)corresponds to one of the ending states and false otherwise.       |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isPaused](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isPaused()) Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)corresponds to one of the paused states and false otherwise.       |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isResuming](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isResuming()) Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState)corresponds to one of the resuming states and false otherwise. |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)   | [name](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#name())                                                                                                                                                                                                                  |

## Public companion functions

### fromId

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

```
fun fromId(id: Int): ExerciseState?
```

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

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the[ExerciseState.id](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#id())to match against |

## Public companion properties

### ACTIVE

```
val ACTIVE: ExerciseState
```

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

```
val AUTO_PAUSED: ExerciseState
```

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

Used only in the manually started exercise.  

### AUTO_PAUSING

```
val AUTO_PAUSING: ExerciseState
```

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

Used only in the manually started exercise.  

### AUTO_RESUMING

```
val AUTO_RESUMING: ExerciseState
```

The session is being automatically resumed.

Used only in the manually started exercise.  

### ENDED

```
val ENDED: ExerciseState
```

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

### ENDING

```
val ENDING: ExerciseState
```

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

### PREPARING

```
val PREPARING: ExerciseState
```

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

### USER_PAUSED

```
val USER_PAUSED: ExerciseState
```

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

Used only in the manually started exercise.  

### USER_PAUSING

```
val USER_PAUSING: ExerciseState
```

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

Used only in the manually started exercise.  

### USER_RESUMING

```
val USER_RESUMING: ExerciseState
```

The session is being resumed by the user.

Used only in the manually started exercise.  

### USER_STARTING

```
val USER_STARTING: ExerciseState
```

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 functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### id

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

```
val id: Int
```  

### isEnded

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

```
val isEnded: Boolean
```

Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/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[isPaused](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isPaused()).  

### isEnding

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

```
val isEnding: Boolean
```

Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/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[isEnded](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnded()).  

### isPaused

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

```
val isPaused: Boolean
```

Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/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[isEnded](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnded()).  

### isResuming

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

```
val isResuming: Boolean
```

Returns true if this[ExerciseState](https://developer.android.com/reference/kotlin/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[isEnded](https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnded()).  

### name

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

```
val name: String
```