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: 
Dhir_Pratap
Streaming Star

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 5
EnTerr
Roku Guru

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
Streaming Star

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
Roku Guru

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? :)), 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
Roku Guru

Re: Resume

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

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
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.