# Interface WorkoutSessionListener

public interface WorkoutSessionListener
Receives workout lifecycle and statistics updates. All callbacks arrive on the EDT.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `workoutEvent(WorkoutSession session, WorkoutEvent event)`
  An event was recorded, whether by the app or detected by the platform.
  `void`
  `workoutFailed(WorkoutSession session, HealthException error)`
  The session failed and will not continue.
  `void`
  `workoutStateChanged(WorkoutSession session, WorkoutSessionState state)`
  The session moved to a new state.
  `void`
  `workoutStatisticsUpdated(WorkoutSession session, HealthDataType type)`
  A live statistic changed.

- ## Method Details

  - ### workoutStateChanged

    void workoutStateChanged(WorkoutSession session, WorkoutSessionState state)

    The session moved to a new state.

    Every transition is one the app asked for in this release, since recorded sessions are the only kind here. The callback exists for the unrequested ones a live session brings -- watchOS ends one when the wearer starts another workout -- so that code written against it keeps working when that arrives.

  - ### workoutStatisticsUpdated

    void workoutStatisticsUpdated(WorkoutSession session, HealthDataType type)
    A live statistic changed. Read the new value with WorkoutSession#getStatistic(HealthDataType, com.codename1.health.AggregateMetric).

  - ### workoutEvent

    void workoutEvent(WorkoutSession session, WorkoutEvent event)
    An event was recorded, whether by the app or detected by the platform.

  - ### workoutFailed

    void workoutFailed(WorkoutSession session, HealthException error)
    The session failed and will not continue.