onSettingsChanged() Problem

I have a complex Data Field in which I want to be able to make user changes from my Garmin Connect App. For some reason, onSettingsChanged() is not being called when I make a change while the Data Field is running, either in the Sim or on my Edge 520 device.

Note:
1. If I make a settings change and RESTART the Garmin Edge 520, the settings change shows up.
2. If I manually call onSettingsChange() every second in the compute() function, the settings change shows up.

But, I think the way this is supposed to work is onSettingsChange() should get auto-triggered on a change, so I don't have to call it myself every second, right?

Details:
==============
I created an onSettingsChanged() function, that I call from initialize() at the start, to grab the default property values at startup. And for debugging, I send a msg to the console to let me know I entered that function. Works great. The Data Field does what I expect. I get a msg on the console. I also send a msg to the data field when onSettingsChanged() is called, letting me know the settings changed, and that shows up on startup. And that works at startup.

BUT.... while it is running in the Simulator, I open "App Settings Editor", make a settings change and send it. It says "Settings sent successfully". But no msg in the console and no msg in the data field. For some reason my onSettingsChanged() function wasn't triggered.

Same happens when I load my App into my Garmin Edge 520 from the Marketplace. Same issue. It runs great. On startup, the "settings changed" msg shows up in the data field letting me know onSettingsChanged() was called from initialize(). But when I change the Data Field's settings in the running Data Field from my Garmin Connect app on my Phone, the Data Field does not change.

Unlike my VivoActive HR, which has a "sync" indicator in the Devices view of Garmin Connect, my Edge 520 just says "connected" and doesn't have a "sync" indicator, so I don't know if those changes actually get sent, and can't initiate a sync. Maybe the updates are instant for a connected Edge device? See image attached.
  • Where is your onSettingsChanged() function? It needs to be in the app, and not in the view. Like-
    class FLdfApp extends App.AppBase {

    function initialize() {
    AppBase.initialize();
    }

    function onSettingsChanged() {
    myColors.load();
    }

    // onStart() is called on application start up
    function onStart(state) {
    }

    // onStop() is called when your application is exiting
    function onStop(state) {
    }

    //! Return the initial view of your application here
    function getInitialView() {
    return [ new FLdfView() ];
    }

    }


    You don't need to call it from within your code, as it will be called when new settings occur. (myColors is a global where I load my app settings, and I create it in initialize() in my view where it does the initial load of settings). The above is the code from my "Simple Data Field" for the 520 if you want to see how it works. With it you can change a few options and colors while it's running
  • Solved!!!

    You guys are AMAZINGLY responsive and helpful. That was my mistake, having it in the View.

    I was confused because my functions like onTimerStart(), etc are in the View.

    Thanks!!