【发布时间】:2012-12-05 10:21:48
【问题描述】:
我想改变PositionChanged Event Handler中的DesiredAccuracy和ReportInterval,以便动态改变不同位置的位置更新频率。
我做了这样的事情,
void geolocator_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
geolocator.StatusChanged -= geolocator_StatusChanged;
geolocator.PositionChanged -= geolocator_PositionChanged;
geolocator.DesiredAccuracy = PositionAccuracy.High;
geolocator.ReportInterval = 5 * 1000;
geolocator.StatusChanged += geolocator_StatusChanged;
geolocator.PositionChanged += geolocator_PositionChanged;
}
但问题是我得到了
$exception {System.Exception: 操作中止(来自 HRESULT 的异常:0x80004004 (E_ABORT))
在
Windows.Devices.Geolocation.Geolocator.put_DesiredAccuracy(PositionAccuracy 值)
我不理解这个异常,因为它没有说明原因。
如何实现这一点(动态更改准确性和报告间隔)?
谢谢。
【问题讨论】:
标签: windows silverlight gps windows-phone windows-phone-8