Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wait to initialize screens

Hey all. 
While developing my channel, I've noticed most (if not all) of the examples, including my own code, automatically initialize all the screens upon app startup. My channel will have alot of requests being made through the main.brs and through tasks, and I don't necessarily want all of that running as soon as my app launches. Aside from tasks and requests, I just generally don't know if I want all that code for the home screen, grid, detail screen, and video screen running as soon as the app loads.

For example:
1) if I have a request that needs to be made on the detail screen - I want that request to run only on the detail screen. I have started a task, but the task is still inside of the init() function, which runs at the beginning of app launch.
2) If I'm trying to display a screen with an error message, I want that screen to initialize only when prompted, not right away with all the other code.

Maybe I missed the documentation but I couldn't see anything that was too helpful, and I searched all the depths of the forums... thanks!!
0 Kudos
Roku Guru

Re: Wait to initialize screens

generally when you launch a new screen you also launch a task that gets the content and allows the screen to populate from the task callback.
I guess there may not be a good example but you can open a new screen from / on top of the existing one.
0 Kudos