SamZ
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2012
02:53 PM
Closing the app when you are several screens deep
I'd like to close my app/channel in some cases, i.e. when I detect an abuse after showing an error message! In some cases I might be several levels/screens deep and I don't keep global references to all my open screens. So when I wanted to exit the app, some of them stayed open! I didn't find any references to exiting the program! I appreciate your help.
10 REPLIES 10

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2012
03:18 PM
Re: Closing the app when you are several screens deep
usually the end statement will kill your channel.
- Joel
- Joel
dustinhood
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
05:11 PM
Re: Closing the app when you are several screens deep
Does the END statement still apply to devices with newer firmware (4.8-5)? I cannot forcibly make a channel exit with a Roku 3 running 5.0.7070
I need the channel to exit once the device is no longer linked to an account.
I need the channel to exit once the device is no longer linked to an account.

gonzotek
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
05:49 PM
Re: Closing the app when you are several screens deep
"dustinhood" wrote:
Does the END statement still apply to devices with newer firmware (4.8-5)? I cannot forcibly make a channel exit with a Roku 3 running 5.0.7070
I need the channel to exit once the device is no longer linked to an account.
If nothing else works, you can send yourself a keypress/Home ECP command.
Credits to renojim for the brightscript code: viewtopic.php?f=34&t=55236#p375957
ipaddrs = CreateObject("roDeviceInfo").GetIPAddrs()
if ipaddrs.eth0 <> invalid then
ipaddr = ipaddrs.eth0
end if
if ipaddrs.eth1 <> invalid then
ipaddr = ipaddrs.eth1
end if
xfer = CreateObject("roURLTransfer")
url = "http://"+ipaddr+":8060/keypress/Home"
xfer.SetUrl(url)
xfer.PostFromString("")
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
dustinhood
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
06:00 PM
Re: Closing the app when you are several screens deep
Thanks will give that I try for now

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
06:04 PM
Re: Closing the app when you are several screens deep
"dustinhood" wrote:
Does the END statement still apply to devices with newer firmware (4.8-5)? I cannot forcibly make a channel exit with a Roku 3 running 5.0.7070
I need the channel to exit once the device is no longer linked to an account.
I just tested on 5.0b7070 and End worked for me.
I don't know if it makes a difference, but I add the following to the same file as RunUserInterface, and just call ExitUserInterface anytime I need to close the channel programmatically, so technically I'm calling End from the global context instead of local:
Sub ExitUserInterface()
End
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
dustinhood
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
06:14 PM
Re: Closing the app when you are several screens deep
"TheEndless" wrote:Sub ExitUserInterface()
End
End Sub
Just tried above with no luck. Does it matter where/how ExitUserInterface() is called?

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
06:17 PM
Re: Closing the app when you are several screens deep
It shouldn't. I use it exactly how it sounds like you're wanting to. As soon as the user chooses to unlink their box, I exit the channel.
ShowMessageBox("Account Unlinked", "Your account has been unlinked. The channel will now close. Please relaunch it to link your player again.")
ExitUserInterface()
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
dustinhood
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2013
06:20 PM
Re: Closing the app when you are several screens deep
Thanks, I will experiment more with it tomorrow.
dustinhood
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2013
06:23 PM
Re: Closing the app when you are several screens deep
For some reason this just won't work...
I've tried using the following workaround, but this doesn't appear to work except for on my newest Roku running firmware 5+.
Any other suggestions?
Sub ExitUserInterface()
End
End Sub
I've tried using the following workaround, but this doesn't appear to work except for on my newest Roku running firmware 5+.
Function forceExitChannel() As Dynamic
ipaddrs = CreateObject("roDeviceInfo").GetIPAddrs()
if ipaddrs.eth0 <> invalid then
ipaddr = ipaddrs.eth0
end if
if ipaddrs.eth1 <> invalid then
ipaddr = ipaddrs.eth1
end if
xfer = CreateObject("roURLTransfer")
url = "http://"+ipaddr+":8060/keypress/Home"
xfer.SetUrl(url)
xfer.PostFromString("")
End Function
Any other suggestions?