Search code examples
javascripttitanium

titanium, save the state of last viewed window


I am wondering if there is a function for saving the last viewed window when a user quits the application, so when they go into the app again, it goes to the last viewed page, instead of restarting. I have looked at Ti.App.Properties but haven't really found what I was looking for. Can anyone point me in the right direction, or if this is even possible.

Thanks


Solution

  • Ti.App.Properties is the way to go.

    If you are just looking to save which window the user was on, simply save the current window that the user is on every time the window changes.

    If you want to save the current state, as your title suggests, you will also want to create a javascript object that holds all the data on the page, do JSON.stringify(object) and then save that string in a property as well.