I'm trying to read the read details of activity just completed in onActivityCompleted() handler in a widget like this:
function onActivityCompleted(activity) {
var actInfo=Activity.getActivityInfo();
if (actInfo!=null) {
var activityCal=actInfo.calories; // returns Number (int)
var durationInMs=actInfo.elapsedTime;
var maxHR=actInfo.maxHeartRate;
.....
The maxHR and calories are always null and the duration is always 0.
It may be coincidental but I was using just the maxHR and it was working (although on a datafield), before the update to SW version 6.4 on the VA4S last week.
It may be however that it was not working even before last week's watch SW update to version 6.4 on the VA4S, since I have not checked in a few weeks and I have not gone back to check the datafield. It may or may not be working.
I cannot comment on the calories and duration values because I had not previously read them before.