protected void makeUseOfNewLocation(Location location) { // Set our text views to the new long and lat mLblLatitudeValue.setText(String.valueOf(location.getLatitude())); mLblLongitudeValue.setText(String.valueOf(location.getLongitude())); GeoPoint point = coordinatesToGeoPoint(new double[] { location.getLatitude(), location.getLongitude() }); CenterLocation(point); // Get Data from server loadPointsFromServer(location); mMapMain.invalidate(); } public static GeoPoint coordinatesToGeoPoint(double[] coords) { if (coords.length > 2) { return null; } if (coords[0] == Double.NaN || coords[1] == Double.NaN) { return null; } final int latitude = (int) (coords[0] * 1E6); final int longitude = (int) (coords[1] * 1E6); return new GeoPoint(latitude, longitude); } private void CenterLocation(GeoPoint centerGeoPoint) { mMapMain.getController().animateTo(centerGeoPoint); };