当我的应用程序工作-我需要检查,全球定位系统-位置是打开的。我不需要任何复杂的事情与statusChanged和其他-只是检查一个值的设置。
如果该设置关闭-我必须停止执行当前操作。在用户执行操作时,我得到了一种每次调用的方法。我想在那里设置支票规则。所以-一定又快又便宜。
有什么人类的方法吗?而不是一直保持GPSWatcher的状态,并检查他的最后状态。我必须关心电池。
谢谢。
发布于 2013-10-12 07:52:29
你可以用这个:
Geolocator geolocator = new Geolocator();
if (geolocator.LocationStatus == PositionStatus.Disabled)
{
...
}
发布于 2015-09-24 15:04:46
根据文件
var accessStatus = await Geolocator.RequestAccessAsync();
switch (accessStatus)
{
case GeolocationAccessStatus.Allowed:
break;
case GeolocationAccessStatus.Denied:
_
break;
case GeolocationAccessStatus.Unspecified:
break;
}
https://stackoverflow.com/questions/19331336
复制相似问题