# ExerciseUpdate.ActiveDurationCheckpoint

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/ExerciseUpdate.kt+class:androidx.health.services.client.data.ExerciseUpdate.ActiveDurationCheckpoint) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/health#1.0.0)

*** ** * ** ***

<br />

```
class ExerciseUpdate.ActiveDurationCheckpoint
```

<br />

*** ** * ** ***

This records the last time the exercise transitioned from an active to an inactive state or from an inactive to an active state, where inactive states match those found in `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isPaused()` or `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseState#isEnded()`. This can be used to calculate the exercise active duration in a way that is consistent with Health Service's view of the exercise.

If the exercise is currently inactive, the exercise's active duration will match `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#activeDuration()` below. If the exercise is active, the active duration can be calculated by `activeDuration + (now() - time)`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#ActiveDurationCheckpoint(java.time.Instant,java.time.Duration)(time: https://developer.android.com/reference/java/time/Instant.html, activeDuration: https://developer.android.com/reference/java/time/Duration.html)` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#activeDuration()` Returns the active duration of the exercise at the time it last transitioned to "active", or the duration when it transitioned to inactive if it's currently paused or stopped. |
| `https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/kotlin/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#time()` Returns the time at which the exercise last transitioned between the active or inactive states. |

## Public constructors

### ActiveDurationCheckpoint

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

```
ActiveDurationCheckpoint(time: Instant, activeDuration: Duration)
```

## Public functions

### equals

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

### hashCode

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

### toString

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

## Public properties

### activeDuration

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

```
val activeDuration: Duration
```

Returns the active duration of the exercise at the time it last transitioned to "active", or the duration when it transitioned to inactive if it's currently paused or stopped.

### time

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

```
val time: Instant
```

Returns the time at which the exercise last transitioned between the active or inactive states.