Reputation: 1993
i have a windows 8 phone application, i would like to stop the app from fast resume when the user selects the back button after they have navigated away from the application. the nature of this application is that it should start afresh every time - just like when the user clicks on the applications tile.
i know there is the activationpolicy setting in the application manifest, however this is for the reverse purpose - enabling fast resume like behavior when the user selects the application's tile.
tia
Upvotes: 0
Views: 525
Reputation: 136
If you’ve seriously thought long and hard about why your app should deviate from the norm and start afresh, then I would just clear the backstack on app resume.
Application_Activated
while (RootFrame.RemoveBackEntry() != null);
Upvotes: 1
Reputation: 16092
Apps can only choose to participate in Fast Application Switching or Fast Application Resume. Developers can't pick and choose which pieces of behaviours work best for them. So you should choose the scheme that works best for your app using the ActivationPolicy in WmAppManifest.ml.
You could potentially catch the OnBackKeyPress event and invoke Application.Current.Terminate() if the backstack is about to be empty. I'm not sure if this violates any certfication guidelines or not, but Microsoft is very sensitive to back button usage and application lifecycle.
Upvotes: 2