Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

programmatic display and dismissal of a dialog while busy

I see from the documentation that roOneLineDialog has a ShowBusyAnimation method(). I effectively want to throw up a "Please wait..." (with busy animation) dialog while I am fetching things from my web API and parsing them. When finished parsing, I want to programmatically dismiss the dialog. I am having trouble getting this to work in code, and I do not see any programmatic method to make the dialog disappear. How can this be implemented in code? Could you please provide an example?
0 Kudos
1 Reply
Level 7

Re: programmatic display and dismissal of a dialog while bus


The dialog will stay on screen as along as the script holds a reference to the dialog object. So to dismiss the dialog set your reference to the dialog to invalid (or exit the scope of your automatic variable by returning from the function). For example:

dialog = CreateObject("roOneLineDialog")

dialog.setTitle("Please wait...")

'fetch web API data here

'this will dismiss the dialog
dialog = invalid
0 Kudos