How to detect Activity?

hi everyone,

so I talk about watchface,

in the sim I use : 

var loc = Activity.getActivityInfo().currentLocation;

if loc = null that means for me no activity, and for the code on the sim that works great!

but on a real device (mine is Fenix 5) that is not so easy, even if no activity, for the watchface, loc is never null.

(actually i don't need my position but i use the same var for sunevent etc.)

is it a bug? or is there a better way to test if an activity is playing?

have a great day!

  • currentLocation won't be null for a while after an activity has ended.  After a period, it will go null, but that could be in the range of hours.

    In a watchface, it won't be null at times even if you're not running an activity.

  • Thanks. 

    In case it would help someone Else, 

    I used starttime, it does not work on sim but works on réal device. 

  • I'm trying to understand here.  You want the WF to know if you are recording an activity?  Best case, that could only happen with a native activity, and then, only if you aren't running any CIQ data fields.

    If an activity has a CIQ DF, you'll only see a native watchface while in an activity and go to the widget loop.

  • My objective is to get the currentheading on a watchface, and detect if an activity is running to trigger it. 

    I ll have to start an activity like running and phold lowest left button to go back to watchface. With this I will be able to get Activity.Info for a watchface.

    Sorry about my English, do you see what im trying to do ? 

  • Yes, you're in an activity and enter the widget look to see your watchface (at that time up/down with take you to the widgets) to see the heading

    But again, that won't work if there is a CIQ data field in use by the activity.

    It seems to me if a user wants to see the heading while recording an activity, they would just set one of the data fields to show that

  • I'll aware all the users about this CIQ data field,

    off course it will be easier to add a DF with this, but I try to use this technic for F3 user, (and cause it was requested too)

    since we can't have access to sensor due to its lower CIQ, with this I can display on F3 info like pressure, temp, alt etc.

    at least I hope so.