Reputation: 612
I am developing an app for windows phone 7.My app communicates with a server which sends it some data which I display on the UI.And I save the state of my app in ApplicationSettings.
And I have found that sometimes
ApplicationSettings.Save() doesnot save the current state.Rather when I start my app it resumes with the previous state which was stored successfully.
Actually I call save method when my app is closing.
But I just want to know if my app is making some changes on the ui.Then is there a possibility that it could be the reason for not saving the state.
If that is the case then what should i do to save my state properly.
Upvotes: 0
Views: 516
Reputation: 2525
If you are saving ONLY when the app is closing (i.e. Application_Closing), then you are not capturing the state often enough. Depending upon how you have exited the app, there are times when the application is simply deactivated, but not necessarily closed. If the app is subsequently tombstoned after deactivation, you will have needed to save the state appropriately to restore it back.
Here is an article to give you a better idea of the different states.
Upvotes: 2