I have a problem calculating the distance between two geopoints.
The geopoints are:
position1 = mapView.getProjection().fromPixels(
(int) e.getX(),
(
you are set the GeoPoint value into the Location object instead of double value try to set as double value of Latitude and Longitude
Location loc = new Location("");
loc.setLatitude(35.1064);
loc.setLongitude(22.556412);
Location loc2 = new Location("");
loc2.setLatitude(22.556412);
loc2.setLongitude(35.1064);
now get the location
float distance = loc.distanceTo(loc2);