简体   繁体   中英

windows phone 8.1 application activing initiallized

How can I make the appliction open as if it's the first time on any activation? That includes fully reseting all its veriables and loading all it's data again.

There are two events that can be fired when an app is "activated". Launching and Activated .

If you want to clear out existing state, you will need to manually do so in the handlers for those two events. Exactly what state you clear out is up to you of course. There is no way to have the framework "reset" an application's state.

For more information on how to handle the Windows Phone application lifecycle, please read: App activation and deactivation for Windows Phone 8

For Windows Phone 8.1, the lifetime, is slightly different, as described at: Application lifecycle (Windows Runtime apps) . For these, just listen for Activated and Resuming .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM