Triggering "onUpdate()"

Former Member
Former Member
Hi,

I know onUpdate() is called every minute and also every second after wakeup.
Is there a way to trigger onUpdate() on other events, e.g. change of phoneConnected()?

Thanks,
Axel
  • Ui.requestUpdate();
    There are a number of times it come in handy. For example, at the end of onSettingsChanged().

    But how will you see a change to phoneConnected? If it's in onParttialUpdate(), you could just update the icon there.

    Are you looking for how you can get triggered when something like phoneConnected changes? Also you can do is check it when you are already running (like in onUpdate())
  • Former Member
    Former Member over 7 years ago
    As far as I understand, my Fenix3 HR doesn't support OnParitalUpdate(), so I have to call Ui.requestUpdate() when I want to update the screen.

    Also you can do is check it when you are already running (like in onUpdate())


    In which function do I have to implement this check?
  • onUpdate gets called either every minute or every second by the system.

    When you are in onUpdate, you display time, etc, and what you do is just check the state of phoneConnected, and display an icon or whatever based on the state. There's no need to call onUpdate again, as you are already running in onUpdate.

    the onPartialUpdate could be used (on watches that support it) so that the icon could be updated every second, all the time, if that's what you were looking for.
  • Former Member
    Former Member over 7 years ago
    Unfortunately my Fenix3 HR doesn't support onPartialUpdate:

    partialUpdatesAllowed = ( Toybox.WatchUi.WatchFace has : onPartialUpdate ); returns "false"

    That means the only thing I can do is to update the icon every minute and to hope that the watch detects the wake-up-gesture so that it gets updated faster, right?

    Is there any chance to react on the light button?
    I guess the answer is "no"
  • You just have to wait for onUpdate(), be it every minute or every second (for 10 seconds) after the gesture.
  • Former Member
    Former Member over 7 years ago
    Thanks,

    Axel