TechBuzzPro

Fast App Resume in WP8: Step-by-Step Setup

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Fast app resume lets a Windows Phone 8 app return to the exact screen and state a user left it in, instead of restarting from the splash screen every time it is relaunched. You enable it by setting the ActivationPolicy to Resume in your app's manifest, then handling the Application_Activated and Application_Deactivated events so your app saves and restores its own state. Nothing extra needs to be installed beyond the Windows Phone SDK and a project that targets Windows Phone OS 8.0 or later.

What You'll Need

  • Visual Studio with the Windows Phone SDK installed (the SDK that matches your target WP8 version).
  • A Windows Phone 8 project that already builds and runs, either Silverlight-based or a Windows Phone XAML app.
  • A physical Windows Phone 8 device or an emulator for testing; the behaviour differs between the two, so test on a device before shipping.
  • Basic familiarity with the app lifecycle events in App.xaml.cs.

Step-by-Step

  1. Open the app manifest. In Solution Explorer, expand Properties and open WMAppManifest.xml. You can edit it in the XML view or through the manifest designer if your SDK version provides one. Menu labels and designer layouts can differ slightly between SDK versions.
  2. Set the activation policy to Resume. Inside the <App> element, find the <ActivationPolicy> element. If it is not present, add it. Set its value to Resume. The result should look like <ActivationPolicy>Resume</ActivationPolicy>. Leaving it as Replace (the default) is what causes the app to restart from the beginning.
  3. Save the manifest and rebuild. Build the solution once so the change is picked up. If the build fails, check that the element is spelled exactly and sits inside <App>, not outside it.
  4. Handle deactivation to save state. Open App.xaml.cs and find the Application_Deactivated handler. This fires when the user leaves your app. Save whatever must survive: the current page, scroll position, form entries, selected item, and any in-progress data. Use PhoneApplicationService.Current.State for small values, or write to isolated storage for larger data. Keep this handler fast; the system gives you limited time before the app is suspended.
  5. Handle activation to restore state. In Application_Activated, check e.IsApplicationInstancePreserved. When it is true, the app was kept in memory and you do not need to reload anything. When it is false, the app was tombstoned or freshly launched, so read your saved values back from PhoneApplicationService.Current.State or isolated storage and restore the UI before the first frame is shown.
  6. Restore navigation correctly. If the user was on a page other than the main page, navigate back to it during activation rather than always landing on the start page. Do this before the app becomes visible so the user does not see a flash of the wrong screen.
  7. Test the normal resume path. Run the app on a device, navigate a few pages deep, press the Start button, then tap the app's tile or use the back stack to return. With fast app resume configured, the app should come back to the same page with the same data, without replaying the splash screen.
  8. Test the cold-start path. Reboot the phone or force-close the app, then launch it again. The app should start normally and still restore any state you persisted to isolated storage. Fast app resume does not replace proper state saving; it only changes how the app is reactivated.
  9. Test deep links and secondary tiles. If your app uses secondary tiles or custom URI associations, launch it through those entry points. Confirm that the correct page opens and that your activation logic distinguishes a fresh launch from a resume.

Common Mistakes

  • Setting the policy but not handling activation. The manifest change alone does not restore anything. Without code in Application_Activated, the app resumes to whatever the UI happened to show, which is often the start page.
  • Ignoring IsApplicationInstancePreserved. Reloading state when the instance was preserved can duplicate data or reset the user's position. Always branch on this flag.
  • Doing heavy work in Application_Deactivated. Long saves can be cut off. Persist incrementally as the user makes changes instead of saving everything at the last moment.
  • Assuming the emulator behaves like a phone. The emulator does not always reproduce real suspension and tombstoning timing. Verify on hardware.
  • Forgetting secondary entry points. Launching from a tile or URI association can take a different code path. Test each one.

Tips

  • Keep the state you store in PhoneApplicationService.Current.State small and serialisable; use isolated storage for anything bulky.
  • Restore the UI before the first frame renders so users never see a blank or wrong page.
  • Log activation reasons during development so you can see whether a launch was a resume, a tombstone, or a fresh start.
  • Test with the phone's battery saver and background settings in their default state, since aggressive power settings can change how often your app is suspended.

Troubleshooting

If the app still restarts from the splash screen, re-open WMAppManifest.xml and confirm <ActivationPolicy>Resume</ActivationPolicy> is present and correctly nested. Rebuild and redeploy; manifest changes are not always picked up by an incremental deploy.

If the app resumes to the wrong page, check that your activation handler reads the saved navigation state and navigates before the UI appears. If state is missing after a cold start, confirm you are writing to isolated storage, not only to the in-memory state dictionary.

If the app crashes on activation, wrap the restore logic in a try/catch and clear corrupted state rather than letting a bad value take down the launch. Clearing app data or reinstalling the app deletes saved state and settings, so warn users and test the recovery path first.

Frequently Asked Questions

Does fast app resume work on all Windows Phone 8 devices?

It is supported on Windows Phone 8 and later. Behaviour can vary with device memory and OS version, so test on your target hardware.

Do I still need to save state if I enable fast app resume?

Yes. Fast app resume keeps the app in memory when possible, but the system can still terminate it under memory pressure. Persist important state so a cold start restores correctly.

What is the difference between fast app resume and tombstoning?

Tombstoning is the older behaviour where the app is terminated and restarted, restoring only what you saved. Fast app resume keeps the running instance and returns to it directly when the system allows.

Can I enable fast app resume for only some pages?

No. The activation policy applies to the whole app. You control which page the user returns to through your own navigation logic in the activation handler.

Why does my app still show the splash screen briefly?

A short splash can still appear on a cold start or after the app was terminated. If it appears on every resume, the policy is likely not applied or the app is being tombstoned each time.