Enum WorkoutActivityType
- All Implemented Interfaces:
Comparable<WorkoutActivityType>
What kind of exercise a workout records.
A deliberate subset
HealthKit defines around eighty activity types and Health Connect around ninety, and the two lists do not line up. An exhaustive mapping table would be large, unverifiable, and wrong in ways nobody would notice until a user's yoga session showed up as pilates.
So this enum covers the common activities honestly and offers OTHER
plus WorkoutSample.getPlatformCode() as the escape hatch for apps
that need exact platform fidelity. Reading getPlatformCode() gives
you the raw HKWorkoutActivityType or ExerciseSessionRecord constant
the platform actually recorded.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn activity this enum does not name. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkoutActivityTypeReturns the enum constant of this type with the specified name.static WorkoutActivityType[]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
-
OTHER
An activity this enum does not name. CheckWorkoutSample.getPlatformCode()for the platform's own value. -
WALKING
-
RUNNING
-
HIKING
-
CYCLING
-
MOUNTAIN_BIKING
-
SWIMMING
-
ROWING
-
ELLIPTICAL
-
STAIR_CLIMBING
-
HIGH_INTENSITY_INTERVAL_TRAINING
-
STRENGTH_TRAINING
-
CORE_TRAINING
-
FUNCTIONAL_TRAINING
-
YOGA
-
PILATES
-
DANCE
-
MARTIAL_ARTS
-
BOXING
-
CLIMBING
-
SKIING
-
SNOWBOARDING
-
SKATING
-
SURFING
-
PADDLING
-
GOLF
-
TENNIS
-
BADMINTON
-
SQUASH
-
TABLE_TENNIS
-
BASKETBALL
-
FOOTBALL
-
AMERICAN_FOOTBALL
-
BASEBALL
-
VOLLEYBALL
-
CRICKET
-
RUGBY
-
WHEELCHAIR
-
COOLDOWN
-
STRETCHING
-
-
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
-