Complete
over 4 years ago

Bug: Activity has :getCurrentWorkoutStep is true even when no workout is selected

I tried this on my Fenix 5s plus and also a user of one of my datafields experienced this with his Fenix 5 plus. Code where this check is used:

if (Activity has :getCurrentWorkoutStep) {

always returns "true" on these watches. Also when no workout is selected.

In the Garmin simulator this isn't the case and the code runs correct.

Parents
  • The expression Activity has :getCurrentWorkoutStep should evaluate to true on devices that have support for this function. The value should not change at runtime for a given device, but it may change when you switch between devices in the simulator. e.g., if you simulate a fenix5spro it should evaluate to true, but if you simulate a fenix3 it should evaluate to false.

    The expression Activity.getCurrentWorkoutStep() should return a WorkoutStep when a workout is active, or null if no workout is active. If the virtual machine evaluates that expression on a platform that doesn't have support (you can tell with the (Activity has :getCurrentWorkoutStep) check mentioned above), the virtual machine will generate a Symbol Not Found error and your app will crash.

    If you believe you are seeing the value of (Activity has :getCurrentWorkoutStep) change at runtime, please post a code snippet or a sample app with specific instructions on how to reproduce.

Comment
  • The expression Activity has :getCurrentWorkoutStep should evaluate to true on devices that have support for this function. The value should not change at runtime for a given device, but it may change when you switch between devices in the simulator. e.g., if you simulate a fenix5spro it should evaluate to true, but if you simulate a fenix3 it should evaluate to false.

    The expression Activity.getCurrentWorkoutStep() should return a WorkoutStep when a workout is active, or null if no workout is active. If the virtual machine evaluates that expression on a platform that doesn't have support (you can tell with the (Activity has :getCurrentWorkoutStep) check mentioned above), the virtual machine will generate a Symbol Not Found error and your app will crash.

    If you believe you are seeing the value of (Activity has :getCurrentWorkoutStep) change at runtime, please post a code snippet or a sample app with specific instructions on how to reproduce.

Children
No Data