- double distance;
- Location locationA = new Location("point A");
- locationA.setLatitude(latA);
- locationA.setLongitude(lngA);
- Location locationB = new Location("point B");
- locationB.setLatitude(latB);
- LocationB.setLongitude(lngB);
- distance = locationA.distanceTo(locationB);
上面的代码不工作,我作为距离得到0.0 Km?
同样在位置类的构造函数中,字符串提供程序是什么意思.
在上面的代码中,我使用的是PointA和PointB作为提供者.
为什么上面的代码不行?
先谢谢你.
logcat的
05-09 17:48:56.144:INFO / current loc(1573):lat 0.0 lng 0.0
05-09 17:48:56.155:INFO / checklocation loc(1573):lat 54.4288665 lng 10.169366