I am and Android/Java newbie and am having trouble creating a GeoPoint when I try to send it a variable, but it woks fine when I send it a literal value.
In the below code block, The toast message displays the correct latitude (retrieved from the strings.xml
How can I set the Latitude using a variable?
Integer intLat = Integer.valueOf(R.string.MexCityLat);
Toast.makeText(HelloGoogleMapsActivity.this, intLat, Toast.LENGTH_SHORT).show();
GeoPoint point = new GeoPoint(intLat , -99120000); //this puts my point near North Pole
//GeoPoint point = new GeoPoint(19240000, -99120000); //this puts my point in Mexico City
OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
GeoPoint
Constructs a GeoPoint with the given latitude and longitude, measured in microdegrees (degrees * 1E6).
Parameters:
Also refer this link for how to convert double,float to geopoint. and be sure you are getting right value for intLat