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: 
Dhir_Pratap
Level 7

Resume

Hi,

I have seen Netflix channel which preserves the screen the user had visited. Ex if the user is watching a movie detail screen and he presses the home button, when he returns back to the app, the movie detail page is launched. Is there any way we can do the same? I am thinking to create a stack for the navigation but not sure where can I store it when the app exits.
0 Kudos
5 Replies
EnTerr
Level 8

Re: Resume

Don't get out of your way trying to emulate Netflix or YouTube - you are not on equal footing, they don't get killed on Home press.

You can leave yourself a breadcrumbs trail using roRegistrySection.
0 Kudos
Dhir_Pratap
Level 7

Re: Resume

EnTerr,
Just out of curiosity is there any way we can prevent our app from being killed on pressing home?
0 Kudos
EnTerr
Level 8

Re: Resume

"Dhir Pratap" wrote:
is there any way we can prevent our app from being killed on pressing home?

Nope. And there shouldn't be.

However: it makes sense for Roku to notify the app it's in the process of being closed (foreclosed? Smiley Happy), so it has a few deciseconds to save the family jewels.

That does not exist yet - but would be easy for the Co. to implement. Say by something like roDeviceInfoEvent^ that the app can listen for and if received, panic as appropriate.

(^) except maybe a "roAppInfoEvent"? Doesn't matter much as long as it exists. Could be even ECP /input, though that'd be probably slightly unclean (unexpected input, potential collisions... )
0 Kudos
Komag
Level 9

Re: Resume

Indeed, I only need a few milliseconds to save the game!
0 Kudos
Dhir_Pratap
Level 7

Re: Resume

I don't really have to save the state on close. I can add the scene to my backstack object when the scene opens. I am looking for a way to retrieve this object when the app is started. I don't think registry will not be enough for me to store the data. But I can give it a try. Is there a way I can serialize/deserialze node object so that it can be stored in registry?
0 Kudos