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

roGridScreen on roScreen

Hey All,

I am trying to make a hybrid app, where the app initially launches to a custom roScreen screen, and a button click will load the roGridScreen. But when I navigate back to the initial (custom screen), I am getting some weird screen which looks like this



Seems like the roGridScreen is not fully cleared. If I click the Back button which triggers
msg.isScreenClosed()
event, the app works fine. But if it is a
 msg.isListItemSelected()
, and try to close the gridScreen manually by


m.screen.close()
m.screen = invalid
msg = invalid


things go wrong.. Any idea on how to fix this? What am I doing wrong here?
0 Kudos
4 REPLIES 4
belltown
Roku Guru

Re: roGridScreen on roScreen

Instead of invalidating the screen and message object when you get the IsListItemSelected event, why don't you just call m.screen.Close () at that point. This will cause an IsScreenClosed () event to be generated which you can handle as you do at present.
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: roGridScreen on roScreen

Are you closing/invalidating the roScreen before opening the grid then rebuilding it after the grid closes?

Other screen components cannot be intermixed with roScreens as the roScreen display stack is maintained independently from the main screen component display stack. When the final roScreen component is closed, other screen components can be used again


http://sdkdocs.roku.com/display/sdkdoc/roScreen
0 Kudos
belltown
Roku Guru

Re: roGridScreen on roScreen

"RokuChris" wrote:
Are you closing/invalidating the roScreen before opening the grid then rebuilding it after the grid closes?

Other screen components cannot be intermixed with roScreens as the roScreen display stack is maintained independently from the main screen component display stack. When the final roScreen component is closed, other screen components can be used again


http://sdkdocs.roku.com/display/sdkdoc/roScreen

I guess I've been doing it wrong too. I have an roScreen that launches an roSpringboardScreen. I've been able to go back and forth between the two without noticing any adverse side-effects. When I hit the Back key or press an on-screen 'Close' button on the roSpringboardScreen, it jumps right back with the roScreen in the same state it was in before. I've changed the code to invalidate the roScreen before launching the roSpringboard screen (and invalidating its message port too, otherwise the next roScreen I created gets key presses meant for the other screen). It still works, although I don't like the screen flicker that takes place when it returns from the roSpringboard screen as it's re-building the new roScreen. I suppose that's just an unavoidable consequence of mixing the two components in this way?
0 Kudos
sonnykr
Visitor

Re: roGridScreen on roScreen

RokuChris wrote:
Are you closing/invalidating the roScreen before opening the grid then rebuilding it after the grid closes?


My answer is no. I didnt invalidate roScreen before opening roGridScreen. Other screens like springBoardScreen (and more) works just fine even the roScreen is not disposed.

But I think I will try the above approach. Thanks Chris.
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.