Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to determine whether the app is returning from being dormant or tombstone?

guys, now I'm developing a windows phone 8 app, I have an issue which is how to determine whether the app is returning from being dormant or tombstone ?

Thanks

like image 497
prebo Avatar asked Feb 03 '26 07:02

prebo


1 Answers

Your app should check the IsApplicationInstancePreserved property of the event args to determine whether it is returning from being dormant or tombstoned. If IsApplicationInstancePreserved is true, then your app was dormant and state was automatically preserved by the operating system. If it is false, then your app was tombstoned and should use the state dictionary to restore application state.

This is the code for details

private void Application_Activated(object sender, ActivatedEventArgs e)
{
     // Determine whether it is returning from being dormant or tombstoned.
     // If it is false, return from tombstoned.
     if (e.IsApplicationInstancePreserved == false)
         //TODO
     else
         //TODO
 }

Wish this can help you.

like image 188
Alen Lee Avatar answered Feb 04 '26 19:02

Alen Lee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!