Geolocator导致PositionChanged事件中止

本文关键字:事件 PositionChanged 导致 Geolocator | 更新日期: 2023-09-27 17:59:36

我的地理定位器有问题,当我将MovementThreshold设置为1时,一切正常,但如果我将其设置为0,则在侦听位置事件更改时会出现Abort错误

Geolocator Locator = new Geolocator();
Locator.DesiredAccuracy = PositionAccuracy.High;
Locator.MovementThreshold = 0;
Locator.PositionChanged += Locator_PositionChanged; // Error occours here but does not occour if Threshold >= 1

有什么原因吗?

Geolocator导致PositionChanged事件中止

将MovementTreshold设置为0与无论如何都不设置相同,如果未设置,则不能使用位置/状态更改事件。在这种情况下,你总是会遇到一个例外。