Returning an application from the background RRS feed

  • Question

  • My application has an interval timer with an event handler that causes an internet query and returns notifications (tile and toasts).  When the application is switched to the background, it continues to perform as expected.  Task manager shows activity and notifications appear.  Sometimes, though, when I try to bring the application to the foreground (by swiping it in), it is terminated.  I have not yet added code for handling the suspend case but as far as I can tell from task manager, it was never suspended.

    Any ideas as to the cause of this behavior?


    Saturday, October 29, 2011 12:20 AM


All replies

  • Hey JR,

    I have not seen this before.  Is it easily reproducible?  Will it happen if you are debugging your app in Visual Studio?  If so you could add this to the top of your JS file: Debug.enableFirstChanceException(true); and that may show something.


    Jeff Sanders (MSFT)
    Monday, October 31, 2011 12:04 PM
  • No. I don't think it has ever failed when in debug mode--just when I execute the app from the start page.  Note that I am not doing any install, just executing the tile that shows up after debugging.

    I tried to add an event handler for the suspend event that would change the tile in order to see if the app went through the suspend state before terminating, but I am having trouble understanding how to do this (see more recent post).

    Monday, October 31, 2011 1:52 PM
  • JR,

    Did the answer on this post help you?


    Were you able to discover what your issue is?



    Jeff Sanders (MSFT)
    Tuesday, November 1, 2011 12:49 PM
  • Jeff,

    The post was a big help and I see that I need to refactor my program.  I don't yet know if that fixes the problem or lets me progress further in the investigation.

    One problem that I do anticipate, though, is how to force my app into the suspend state.  From what I've seen using the task manager, when I move my app to the background and even load up other apps, it remains active.  I see other apps going to suspend but rarely, if ever, did I see my app suspend (according to task manager).


    Tuesday, November 1, 2011 1:36 PM
  • I think I have an understanding of this now.  I wired up a suspend event handler that is detecting that the application is going through suspend before being terminated.  I guess the refresh rate of the task manager just did not show it as I was expecting.


    • Marked as answer by jrboddie Wednesday, November 2, 2011 12:03 AM
    Wednesday, November 2, 2011 12:02 AM