Hey all,
I am creating a watch face and there is some code that I only want to run when the user completes an activity (as opposed to running it super frequently onUpdate).
How can I do this?
Thanks!
Hey all,
I am creating a watch face and there is some code that I only want to run when the user completes an activity (as opposed to running it super frequently onUpdate).
How can I do this?
Thanks!
With a watch face, most of the time onUpdate is only called once a minute. but for a short time after something like a gesture, it will be called every second. On some devices, before onUpdate is called, the screen will be cleared, so you really want to draw the entire screen each and every time onUpdate is called.
Drawing every time onUpdate is called makes sense, but there's other processing that would ideally be done less frequently that generates the data for the watch face to show.
ideally I would generate this data after an activity is finished and then just render the stored data in onUpdate.
Any thoughts on my previous response? Thanks!
I've never used this, but for an app with a background service you could try using
registerForActivityCompletedEvent()
and then in the background service,
onActivityCompleted()