public static async Task<Position> GetCurrentLocation()
{
try
{
var locator = CrossGeolocator.Current;
locator.DesiredAccuracy = 100;
if (!locator.IsGeolocationAvailable)
throw new NotSupportedException("Geolocation not available");
if (!locator.IsGeolocationEnabled)
throw new GeolocationException(GeolocationError.PositionUnavailable);
return await locator.GetPositionAsync(timeoutMilliseconds: 100000);
}
catch (Exception ex)
{
//TODO: Add error logging
return null;
}
}
<{1>}
return await locator.GetPositionAsync(timeoutMilliseconds: 100000);
线程退出和调试器不返回但输出窗口正确显示位置但未返回到代码。这次休息的可能原因应该是什么?