public enum WorkoutSessionState
- Object
- Enum<WorkoutSessionState>
- WorkoutSessionState
ImplementsComparable<WorkoutSessionState>
The lifecycle of a WorkoutSession.
Transitions are enforced: calling a method that does not apply to the
current state fails with
HealthError.SESSION_STATE rather than silently
doing nothing or throwing.
Enum constants
NOT_STARTED | Created but not yet prepared or started. |
PREPARING | Sensors are warming up. |
RUNNING | Recording. |
PAUSED | Paused. |
STOPPED | Stopping: collection has ceased but the workout has not been written yet. |
ENDED | Ended and persisted. |
FAILED | Ended in error, or discarded. |
Methods
public static WorkoutSessionState[] values() | |
public static WorkoutSessionState valueOf(String name) |
Inherited methods
Enum constant details
NOT_STARTED
NOT_STARTEDCreated but not yet prepared or started.
PREPARING
PREPARINGSensors are warming up. Optional – see
WorkoutSession.prepare() – and worth using if you show a
countdown, because heart rate is not immediately available when a
session begins.RUNNING
RUNNINGRecording.
PAUSED
PAUSEDPaused. The elapsed clock stops; wall-clock time keeps passing and
is excluded from
WorkoutSession.getElapsedMillis().STOPPED
STOPPEDStopping: collection has ceased but the workout has not been
written yet.
ENDED
ENDEDEnded and persisted.
FAILED
FAILEDEnded in error, or discarded.
Method details
values
public static WorkoutSessionState[] values()valueOf
public static WorkoutSessionState valueOf(String name)