【发布时间】:2013-03-17 10:00:04
【问题描述】:
我测试了下面的代码 sn-p。我突然得到一个奇怪的位置 (0,0) 作为纬度和经度,这干扰了我的距离计算。
if (loc != null) {
double currentLatitude = loc.getLatitude();
double currentLongitude = loc.getLongitude();
if (first_time) {
loc.reset();
first_time = false;
}
synchronized (testObject) {
… do some work
previousLat = currentLatitude;
previousLon = currentLongitude;
}
}
我想知道纬度和经度在什么情况下变为 0。我还想知道我的代码在哪里出错,因为我得到了 0 纬度和经度。 location.reset()的结果是0经纬度吗?
【问题讨论】:
标签: geolocation gps location android-location