Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Simulating tombstone (suspended state) on Windows Phone 7 emulator

DZone's Guide to

Simulating tombstone (suspended state) on Windows Phone 7 emulator

· Mobile Zone
Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

Since Windows Phone 7 doesn’t have multitask, at least for now, Microsoft implemented a Tombstone notion in WP7 apps.
It’s basically a suspended state where you receive a notification that it’s going to suspend but there is no guarantee that it will resume, it might be terminated so you must treat this as an exit and a might start again state.

So depending on you app you might want to save the current state just in case the app really closes.

Simulating this on the emulator took me awhile to get it right.

Press F5 on Visual Studio do start debugging your App.
Press the Start button and your app received a Deactivated event. Save what you need. Now, and here is the tricky part, the debugger also exited.
This took me awhile because pressing the back button wouldn’t do anything and pressing F5 again would just restart.

So you have to Press F5 and keep an eye on the compiler. When you receive a “Deploy Success” message

quickly press the Back button on the simulator

You app should now start and receive the Activated event.
Basically the debugger has to start between you pressing the Back button and before the black screen disappears otherwise the emulator while assume the app is closed and get back to home.

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

Topics:

Published at DZone with permission of David Amador, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}