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

Skipping PosterScreen - back functionality broken

When you open my app you are presented with a list of 'content providers' (this is the HomeScreen) each content provider has a list of feeds when you click into them (The Poster screen).

When a provider only has one feed my app will just go right to the DetailScreen of that feed. However if you hit back (The up arrow) and return to the HomeScreen) you are then unable to select any of the content providers. You can scroll to any of them, but pressing enter does nothing and there is no debug output.

If I render the poster screen and then jump into the details page automatically this will work because hitting the back button takes you the PostScreen (there will only be the single feed) and then back again will take you to the HomeScreen and everything works fine. However, this looks a bit clunky and would love to avoid having to do this. I suspect I just need to do something on exit of the details page. I'm just not sure what.

Having Issues:
    categories = getSourceCategoriesList(source)
shows = getShowsForSourceItem(source, m.curSource)
screen.SetListNames(categories)
screen.SetContentList(shows)

if shows.Count() = 1
print "Only 1 show was found...Choosing that"
m.curShow = displayShowDetailScreen(source, m.curShow)
'screen.SetFocusedListItem(m.curShow)
print "list item updated | new show = "; m.curShow
else
screen.Show()
end if


Works, but clunky:
    categories = getSourceCategoriesList(source)
shows = getShowsForSourceItem(source, m.curSource)
screen.SetListNames(categories)
screen.SetContentList(shows)
screen.Show()

if shows.Count() = 1
print "Only 1 show was found...Choosing that"
m.curShow = displayShowDetailScreen(source, m.curShow)
'screen.SetFocusedListItem(m.curShow)
print "list item updated | new show = "; m.curShow
end if
0 Kudos
2 REPLIES 2
RokuKevin
Visitor

Re: Skipping PosterScreen - back functionality broken

You didn't share all your code, but I suspect your event loop processing doesn't match your screen display stack. Your screens get added to the display stack when you call Show() and will get focus after the screen above it pops. When your screen has focus, it can send events to your brightscript app.

Make sure event loop processing matches the display stack. This is natural when you have a function that includes a Show() and event processing for a particular screen.

--Kevin
0 Kudos
bmckim
Visitor

Re: Skipping PosterScreen - back functionality broken

I have resolved the issue, thanks for your help.

I re-architected so the message ports were not opened if the screen was being skipped (which makes sense).
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.