Resuming WP7 app when in background instead of launching new instance

414 Views Asked by At

I have a question about WP7's (Mango) behavior in the following scenario:

  • Open a new instance of an app and play a song
  • Press the windows button to navigate to the home screen
  • Song continues to play
  • Open the application again by either tapping on it's icon on the home screen, or by using the song's title in the universal volume control

I know both of these actions will call the Application_Launching event. But because the application is still in memory (in the background), is it possible to override that event and just have the application resume (ie. bring it into the foreground similar to just pressing back)?

Because the song is still playing, I think this would be the most intuitive behavior. However, based on this post: http://programming4.us/mobile/2962.aspx, it feels like I'd be committing WP7 taboo. Can someone let me know what the proper way to handle this scenario is?

1

There are 1 best solutions below

0
On

Launching th eapplication from the application list or the main tile (if pinned) should always start the app with the default behaviour on the main page. If the app displays information about the currently playing track then you shoudl display this information as appropriate.

If you're playing music in the background you can detect being launched from the UVC* and then display the appropriate page/content.

*By checking the NavigationContext.QueryString for the "NowPlaying" parameter, in the same way as if detecting launch from the Music+Video hub.