Restarting Windows Store Apps programmatically

萝らか妹 提交于 2019-12-11 03:47:36

问题


I know that one can use MSApp.terminateApp to kill the application. What about restarting an app? Is there any command for restarting?


回答1:


Restarting does not fit within the Windows 8 Application concept (formerly metro). If you get into an unrecoverable state then the appropriate thing to do is let it crash and let windows handle it from there.

From here:

App crash

Apps are required to follow the system crash experience, which is to simply return to the Start screen. The system crash experience is designed to get users back to what they were doing as quickly as possible, so you shouldn't provide a warning dialog or other notification because that'll cause a delay for the user. The disappearance of the app should make it clear to the user that something went wrong.

If your app crashes, stops responding, or generates an exception, Windows asks the user for consent to send a problem report to Microsoft. Microsoft provides a subset of the error data in the problem report to you so that you can use it to improve your app. You'll be able to see this data in your app's Quality page in your Dashboard in the Windows Dev Center for Metro style apps. (Note that you can't submit apps or view your app's data until the Windows Store opens for general submissions.)

When the user activates an app after it crashes, its activation event handler receives an ApplicationExecutionState value of NotRunning, and should simply display its initial UI and data.



来源:https://stackoverflow.com/questions/11962230/restarting-windows-store-apps-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!