Hi,
I don't know why but when I run my app on simulator onUpdate call twice and after that never called why?
Hi,
I don't know why but when I run my app on simulator onUpdate call twice and after that never called why?
According to this information: https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/View.html#onUpdate-instance_function
the function is called once when the view is brought to the foreground. It is invoked automatically for watch faces (once per minute or second) and data fields (once per second), but not for apps. It is also invoked by calling WatchUi.requestUpdate(), which I believe is what you need to do in this case.
Yes, for a widget or device app, the app itself needs to call WatchUi.requestUpdate() for onUpdate() to be called. A common way to do this is to have a timer that calls requestUpdate() on a regular basis.
Depending on what the app does is can be driven by something else, such as onBackgroundData or the callback for new sensor data