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

```
public final 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/androidx/health/services/client/data/ExerciseState#isPaused()` or `https://developer.android.com/reference/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/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/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#ActiveDurationCheckpoint(java.time.Instant,java.time.Duration)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html time, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html activeDuration )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Duration.html` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#getActiveDuration()()` 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. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/time/Instant.html` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#getTime()()` Returns the time at which the exercise last transitioned between the active or inactive states. |
| `int` | `https://developer.android.com/reference/androidx/health/services/client/data/ExerciseUpdate.ActiveDurationCheckpoint#hashCode()()` |
| `@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/ExerciseUpdate.ActiveDurationCheckpoint#toString()()` |

## Public constructors

### ActiveDurationCheckpoint

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

```
public ActiveDurationCheckpoint(
    @NonNull Instant time,
    @NonNull Duration activeDuration
)
```

## Public methods

### equals

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

### getActiveDuration

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

```
public final @NonNull Duration getActiveDuration()
```

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.

### getTime

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

```
public final @NonNull Instant getTime()
```

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

### hashCode

```
public int hashCode()
```

### toString

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