Question

i want to ask some questions about the life cycle of Windows Phone apps

i read more articles about this topic but i can't get some points :

1- why sould i save the data before the app being deactivated as it will be in memory ? is that only anticipation to if it terminated?

2- what is the difference between dormanant and tombstoned states as the phone save state for both ? is it only the limitations of 5 apps in case of tombstoned?

3- finally when the data of the app already gone in which state and in when event fired?

Was it helpful?

Solution

  1. Yes. The application could be terminated/tombstoned and you would not get a chance to handle that.

  2. From the MSDN docs: "A tombstoned app has been terminated, but the operating system preserves information about its navigation state and also preserves the state dictionaries the app populated during Deactivated."

    The difference is that a deactivated app preserves all information in memory but suspends execution, where as a tombstoned app also removes the app from memory, keeping only a small amount of State information in a dictionary, and the current page.

  3. I don't quite understand this question. In terms of tombstoning, you should assume the data is gone after the Application_Deactivated event fires, since you may be tombstoned at any time after that. It may turn out you get reactivated and have not tombstoned, in which case your memory state prior to deactivation is preserved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top