我是 Android/Java 新手,当我尝试向它发送变量时创建 GeoPoint 时遇到问题,但是当我向它发送文字值时它可以正常工作。
在下面的代码块中,toast 消息显示正确的纬度(从 strings.xml 检索
如何使用变量设置纬度?
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!");