Enum WorkoutSessionState
- All Implemented Interfaces:
Comparable<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 Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkoutSessionStateReturns the enum constant of this type with the specified name.static WorkoutSessionState[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
NOT_STARTED
Created but not yet prepared or started. -
PREPARING
Sensors are warming up. Optional -- seeWorkoutSession.prepare()-- and worth using if you show a countdown, because heart rate is not immediately available when a session begins. -
RUNNING
Recording. -
PAUSED
Paused. The elapsed clock stops; wall-clock time keeps passing and is excluded fromWorkoutSession.getElapsedMillis(). -
STOPPED
Stopping: collection has ceased but the workout has not been written yet. -
ENDED
Ended and persisted. -
FAILED
Ended in error, or discarded.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-