how to find the distance between two geopoints?

后端 未结 6 1917
遇见更好的自我
遇见更好的自我 2020-12-06 01:55
double distance;  

Location locationA = new Location(\"point A\");  

locationA.setLatitude(latA);  
locationA.setLongitude(lngA);  

Location locationB = new Locat         


        
6条回答
  •  再見小時候
    2020-12-06 02:08

    This is not an answer, but note the signature for the Location constructor is Location(String provider).

    i.e. the String you pass to the constructor should be one of LocationManager.GPS_PROVIDER, LocationManager.NETWORK_PROVIDER or LocationManager.PASSIVE_PROVIDER, not "point A" and "point B".

提交回复
热议问题