Complete
over 3 years ago

When is it not ok to call WatchUi.requestUpdate();?

Hi,

This one is a new one on me!

I saw an ERA log from onSettingsChanged that crashed out on my DataField onSettingsChanged handerl:

    function onSettingsChanged() {
        if(view) {
            view.onSettingsChanged();
            WatchUi.requestUpdate(); // CRASHES HERE
        }
    }

There is nothing contentious that I can see in onSettingsChanged (except a slightly annoying Attention.playTone that I had decided to remove on account of it being annoying in any case) - just some maths that is null checked, valid and safe.

So:

1. Is there any time that it is either illegal or unwise to call WatchUi.requestUpdate()

2. How does one test for that?

Thanks,
G

Parents
  • [quote userid="3042" url="~/developer/connect-iq/f/discussion/246510/when-is-it-not-ok-to-call-watchui-requestupdate/1171478"]The only restriction I know of is you can't use it in a data field.[/quote] That might, just might be relevant here! [quote userid="156797" url="~/developer/connect-iq/f/discussion/246510/when-is-it-not-ok-to-call-watchui-requestupdate"]that crashed out on my DataField[/quote] Thanks, Slight smile
Comment
  • [quote userid="3042" url="~/developer/connect-iq/f/discussion/246510/when-is-it-not-ok-to-call-watchui-requestupdate/1171478"]The only restriction I know of is you can't use it in a data field.[/quote] That might, just might be relevant here! [quote userid="156797" url="~/developer/connect-iq/f/discussion/246510/when-is-it-not-ok-to-call-watchui-requestupdate"]that crashed out on my DataField[/quote] Thanks, Slight smile
Children
No Data