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.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SkipFire
Visitor

Channel exiting early

I have a channel that has a configuration screen that opens the first time you go into the application, and it works fine, the problem is the channel exits after I leave the configuration screen. I've read through the docs and not found this behavior, but I am guessing it is because I have closed the last open screen even though I have subsequent code to execute. Does the Roku automatically exit a channel as soon as no screen is showing? Moving my code for the config to happen after another screen is opened will take a lot of work, so I want to make sure that is the problem before I do it. I don't get any errors in the telnet window.
0 Kudos
6 REPLIES 6
TheEndless
Channel Surfer

Re: Channel exiting early

Yes. As soon as the last screen is closed, the channel will exit. You'll need a facade screen to prevent the channel from exiting before you want it to. See RokuKevin's post here: viewtopic.php?f=34&t=26350&p=162550#p162550
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Channel exiting early

The need for a facade is also mentioned in the Developer Guide: http://sdkdocs.roku.com/display/RokuSDK ... kuPlatform
0 Kudos
SkipFire
Visitor

Re: Channel exiting early

Thanks for the feedback, guess it's back to the code window I go.
0 Kudos
TheEndless
Channel Surfer

Re: Channel exiting early

"SkipFire" wrote:
Thanks for the feedback, guess it's back to the code window I go.

You literally just need to add three lines of code to your RunUserInterface()/Main() function, and you should be good to go...
Sub RunUserInterface()
InitTheme()
facade = CreateObject("roPosterScreen")
facade.Show()

' All of your current code

facade.Close()
End Sub
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
SkipFire
Visitor

Re: Channel exiting early

Nifty, I'll give that a try.
0 Kudos
SkipFire
Visitor

Re: Channel exiting early

That facade trick worked beautifully, thanks.
0 Kudos