Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
sonnykr
Level 7

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
belltown
Level 7

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.
https://github.com/belltown/
0 Kudos
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
Level 7

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?
https://github.com/belltown/
0 Kudos
sonnykr
Level 7

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