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
  • Yep, I did expect "Activity has :getCurrentWorkoutStep" to be true only when a workout is selected! Thanks for clarifying this!

    However, it is still strange that the simulator and a real watch act differently when this instruction is used. I would expect them to behave the same.

Comment
  • Yep, I did expect "Activity has :getCurrentWorkoutStep" to be true only when a workout is selected! Thanks for clarifying this!

    However, it is still strange that the simulator and a real watch act differently when this instruction is used. I would expect them to behave the same.

Children
  • 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.

  • Trying opening your SDK manager and letting the devices update. If I'm not mistaken, Fenix 5 Plus devices only recently got support for 3.2. It may be that you have the older device definitions.