locked
Windows 8.1 and ClosedByUser - start fresh or restore?

    Question

  • The 8.1 documentation for ApplicationExecutionState.ClosedByUser says:

    "In Windows 8, display its initial UI and perform initialization tasks, rather than restoring its previous state.In Windows 8.1, restore itself to the way the user left it, rather than starting fresh. Use data saved during app suspension. Refresh content or network connections that may have become stale."

    The "Guidelines for app suspend and resume" say "Don't restore state for an app that was explicitly terminated by the user."

    The "Application lifecycle" page says "Start with default data"

    Which is the standard guidance now: restore or start fresh?

    Thank you!

    Thursday, April 24, 2014 11:56 PM

All replies

  • Hi MarkT,

    Good question, thanks for your feedback.

    Per my understanding, ClosedByUser is a user want to terminate the app but not restart it, that's why ApplicationExecutionState enumeration mentioned "takes longer than 10 seconds to activate the app again". If the user want to restart the app, probably he might want to refresh the app, he will re-start the app within 10 seconds.

    However I will consult with senior engineers to see if we can provide some more suggestion or if it is the problem with the MSDN documentation. Looks like a conflict story.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Friday, April 25, 2014 2:15 AM
    Moderator
  • Thanks James. I thought the "10 second rule" was to give the app time to perform its suspension logic, i.e. if the user restarted the app within a few seconds, the app might not have completed writing its session state to disk/registry so it would be difficult for the app to restore, so Windows would report NotRunning instead of ClosedByUser during those 10 seconds? In any case, thanks for checking, it might just be a case where all the documentation hasn't caught up to the new guidance.
    Friday, April 25, 2014 2:39 AM