Hi,
I want to save some Session data once the activity has ended, and I do it inside onTimeReset event. I save lap data too, and I do it inside onTimerLap event. This lap data has to be saved when stop button has pressed, so you can see last lap data and the total data along the activity. Something like that:
function onTimerLap() {
LapField1.setData(...);
LapField2.setData(...);
...
}
function onTimerStop() {
LapField1.setData(...);
LapField2.setData(...);
...
SessionField1.setData(...);
SessionField2.setData(...);
...
}
function onTimerReset() {
LapField1.setData(...);
LapField2.setData(...);
...
SessionField1.setData(...);
SessionField2.setData(...);
...
}
When run in simulator all works fine and the Stop an Reset events are called and the code inside then executed, as in Lap event. But when run in watch (Forerunner 735XT with last firmware update) only the Lap event is executed, and neither the Stop nor Reset events are called, or the code inside them is not executed.
There is a very strage thing about Timer events. If I copy the code inside the event to a function, and then call this function, the function is not called from inside the events. If there is some code before the function call, it's executed, but not the function calling and the code after the funcion call. And this error occurs both on simulator and watch. Function saveLapData() is not called from inside none of the events. So I have to repeat same code inside the events instead of call another funtion to do the job.
function saveLapData() {
LapField1.setData(...);
LapField2.setData(...);
...
}
function onTimerLap() {
Code here is executed properly;
saveLapData; // not executed
}
function onTimerReset() {
Code here is executed properly;
saveLapData; // not executed
SessionField1.setData(...); // not executed
SessionField2.setData(...); // not executed
...
}
I've tried with 2.x.x and 3.x.x SDK versions, and the same with all of them.
Regards,