【发布时间】:2013-01-26 21:14:32
【问题描述】:
在我的 WP8 应用程序中,我使用所有传感器。加速度计、指南针(来自 Windows.Devices.Sensors 和 Microsoft.Devices.Sensors)和倾角计。 一切正常,直到我按下 Windows 按钮,然后按下 Back 按钮。 我得到一个带有 “Resuming...” 消息的全黑屏,但没有任何反应。一旦我得到一个异常(从 5 失败只有一次):
{System.Runtime.InteropServices.SEHException: External component has thrown an exception.
at Microsoft.Devices.Sensors.SensorBase`1.PauseSensor()
at Microsoft.Devices.Sensors.SensorBase`1.<>c__DisplayClass7.<.ctor>b__4(Object sender, NotificationCallbackEventArgs args)
at Microsoft.Devices.Sensors.SensorCallback.MS.Internal.Interop.INotificationCallback.Pausing(XPauseType pauseType)
at MS.Internal.Interop.NotificationService.NotificationPausing(XPauseType pauseType)
at MS.Internal.FrameworkCallbacks.NotificationPausing(UInt32 pauseType)}
有人遇到过这个例外吗?
或者是否有在 wp8 应用程序生命周期中正确使用传感器的最佳实践?
谢谢
【问题讨论】:
标签: windows-phone-8 sensors application-lifecycle