【问题标题】:Why the OnSuspending event was not called on my WP8.1 Store app?为什么在我的 WP8.1 商店应用程序上没有调用 OnSuspending 事件?
【发布时间】:2015-03-03 00:33:23
【问题描述】:

我创建了一个非常简单的 WP8.1 Store 应用程序,并尝试了一个实验,点击无论 Win-Key 还是 Back-Key 使应用程序进入后台,但根本没有调用 OnSuspending 事件。

我很好奇当前应用的状态是什么?跑步还是暂停?为什么没有调用 OnSuspending 事件?与 MSDN 不符在:https://msdn.microsoft.com/en-US/library/windows/apps/hh464925.aspx

【问题讨论】:

    标签: windows-phone-8.1 windows-8.1


    【解决方案1】:

    Visual Studio 在调试应用时禁用 Windows 运行时的进程生命周期管理 (PLM),因此 PLM 和断点不会相互干扰。由于应用程序不会自然挂起,Visual Studio 提供了挂起和恢复按钮来模拟该过程。见How to trigger suspend, resume, and background events for Windows Store apps in Visual Studio

    【讨论】:

      猜你喜欢
      • 2014-12-03
      • 1970-01-01
      • 2018-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-12
      相关资源
      最近更新 更多