Dynamically load ViewLoop Views

Hi There

I'm new to developing garmin widget apps and I am trying to build the following:

  • Fetching Data from a rest backend - array of items
  • show for each item a view with the ViewLoop

I was able to fetch data and show them on a simple label on a static view. As next I tried to adjust me widget depending on the "primates"-example with the ViewLoop in it.

As far as I understand is the PageIndicatorFactory the entrypoint of the ViewLoop an initializes the Views. I'm not sure where to put the fetch-data mechanism to show dynamically views, depending of the response of the request. In other words: The ViewLoop must wait with it's init process until I have fetched the data.

Do you have an idea how this could be solved?

kind regards Leon

  • In your main view you want to request the data and block access to the other views until you have the needed data, maybe in the delegate where you switch views, if I understand your issue

  • Yes, that's what I'd like to do :-)

    Do you know how I can add Views after loading the data. In other words. I want to show a loading text and after that the ViewLoop.

    Pushing the whole viewLoop over the init screen after loading?