How would i go about saving the state of the last viewed window of my application?
I have been trying titanium.app.properties with no luck. I am using MVC
so everything is split up into separate files. Would I go about this by making a couple of global variables in the model, and calling them with app.properties? If you can help, could you please provide an example?
Thanks for any help <3
The Pageflow Widget has an example of how you can handle this.
There is a global variable that holds all the pages that were initialized and pushes them onto an array, like a stack.
It then has a back handler:
You can see the complete working code by downloading and running the widget. This code does a lot more, but you can see how their back function works and remembers the previous screen.
https://github.com/jolicode/Badass-Pageflow
So i have been able to get it to work by simply doing as stated in another answer. for anyone interested It goes as follows
$.index.open()
save a property i.eTi.App.Properties.setString("lastwin",nameofwindow)
in the focus event of each window also update the name in the string.something like :
window.addEventListener("focus",function(){
});
Hope it helps.