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: 
jeremyk
Visitor

Code related to back button implementation?

I am looking at implementing the Back Button code (EnableBackButton) and having no luck at all. Anyone willing to share their implementation or have a simple way to explain the implementation? I don't see any sample code that shows this actually working.

Thanks!
0 Kudos
4 REPLIES 4
TheEndless
Channel Surfer

Re: Code related to back button implementation?

Where specifically are you trying to implement it? The back button functionality is automatic on all screens except the roImageCanvas and the roMessageDialog(s). On the roImageCanvas, you just need to look for the isRemoteKeyPressed event with an index of 0, and on the message dialogs, you just need to call the EnableBackButton() method you mentioned in your post.
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
jeremyk
Visitor

Re: Code related to back button implementation?

Thanks for the quick response. In my case it is just roMessageDialog then, so when I create the object do I just set EnableBackButton and then when the user hits the button it returns isScreenClosed() just like normal? For example:

dialog = CreateObject("roMessageDialog")
dialog.EnableBackButton(True)

And thats it?
0 Kudos
TheEndless
Channel Surfer

Re: Code related to back button implementation?

I've never actually used it on the roMessageDialog, but yes, I believe that's how it works. As long as you call .EnableBackButton() before you call .Show(), the user should be able to exit the dialog with the back button.
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
jeremyk
Visitor

Re: Code related to back button implementation?

Awesome, thanks for the help, I figured I was overcomplicating it.
0 Kudos