Should I launch fresh instance or restore last when app is deactivated and started again through app list?

StackOverflow https://stackoverflow.com/questions/9165052

Question

I read a lot about application states, tombstoning and recommended practises but I am still confused

Here is my scenario

  • User launches app through application icon.
  • User then moves to next page.
  • User Click on Windows button.
  • User launches app again using application icon

What should happen here?

  • My second page should be displayed? because user didn't quit the app through back button
  • Main page should be displayed? because user launched it through app list which means new instance

MSDN says

Ensure that when your application is launched by the user from Start or the installed applications list, the user is taken to a consistent launch experience. It should be evident to the user that they are experiencing a new application instance.

Does this mean that I should launch the main page again not second page?

If yes, should my app state only be restored(to second page) when user comes to my app through back button and Application_Activated event is fired?

Was it helpful?

Solution

You should start new instance of application.

I believe this is also part of certification process.

And the whole thing would get quite complicated, because only way to ensure, that application is onpened on same page, with same data, is to save whole state into isolated storage.

OTHER TIPS

Unless you're doing some crazy custom stuff, this should be handled for you as page navigation is supported by the deactivation process.

If the user backs into your application, the last page they were on will be restored and PhoneApplicationService.Activated will be raised (ActivatedEventArgs.IsApplicationInstancePreserved will be true if you don't need to unpersist your state).

If the user accesses your application from start, the application's default page will be loaded and PhoneApplicationService.Launching will be raised.

The only thing I would show first one time only is the help or options screen so a new user can get to know the app.

From that time on, when the app is started it should start with the key/main page that the user wants to use.

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