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.
“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… )
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?