locked
App restarts instead of resuming

    Question

  • We have found a problem that when the user switches from the app, if he switches back to it after waiting for 10 seconds, the app is restarted instead of resuming.

    After some investigation, we have gathered this additional info:

    - If the app preview is observed in the fast switch bar, it can be seen that the app is running and updating even after 10 seconds

    - When app is launched again and is being restarted, it receives NotRunning as the previous state in the activation callback.

    - There are no crashes in the event log

    - There are no crashes in the windows error reporting list

    - We have an app already in the store and we have not received any crash dumps for launch/suspend/resume and any related handlers

    - If the debugger is attached, the app resumes correctly

    - If the user goes to the old desktop and then back again to the start screen and re-launches the app, it is resumed correctly

    Can anyone give us some ideas on the solution to this problem?




    Friday, November 01, 2013 3:25 PM

All replies

  • Can you clarify the repro steps and environment (is this Windows 8 or Windows 8.1)?

    It takes a bit of time after switching away from the app before it suspends. If the user closes the app (i.e drags it from the top of the screen down) and then reopens it before it can suspend then the old app gets killed and the app gets restarted and its suspend handlers don't get called.

    This isn't a crash and so there won't be a dump.

    If the user just alt-tabbed away, waited a bit for the app to suspend, and then went back to the launch the app it may resume or it may restart. This will depend on what else is going on in the system, and the app needs to be able to handle both scenarios smoothly. Again, this isn't a crash and so there won't be a dump.

    See App suspend and resume

    --Rob

    Friday, November 01, 2013 7:41 PM
    Owner
  • This happens on Windows 8 with an App built for Windows 8 and on Windows 8.1 with an app built for Windows 8.1

    Steps to reproduce on Windows 8.1 are:

    -launch the app

    -press the Win Key

    -on a PC, move the mouse to the upper left corner and down to open the fast switch bar with running App previews or make the similar gesture on a tablet

    -observe that the app is running (app should animate something)

    -wait for 10+ seconds, the app is still running

    -click on the app preview, app splash screen is displayed and the app is restarted

    (Our app is a DirectX game that is not using XAML)

    For additional info, the debug version of the app is suspended after 10 seconds (the animation in the preview stops) and resumes correctly. If I attach the debugger to the release version and use the Suspend/Resume buttons in Visual Studio, the release version of the app is suspended and resumed correctly.

    The Windows Cert Tool v3.1 does not find any issues with suspend/resume tests or any other tests for that matter.


    • Edited by Vyacheslav Egorov Sunday, November 03, 2013 2:26 PM A typo and more info on release version behaviour
    Sunday, November 03, 2013 2:24 PM