Forum Discussion

Dhir_Pratap's avatar
Dhir_Pratap
Streaming Star
10 years ago

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.
  • 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.
  • EnTerr,
    Just out of curiosity is there any way we can prevent our app from being killed on pressing home?
  • "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... )
  • Indeed, I only need a few milliseconds to save the game!
  • 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?