我是Android和Java新手,在嘗試發送變量時遇到了創建GeoPoint的麻煩,但是當我發送一個字面值時,它很好。當傳遞變量時,GeoPoint不能正常工作
在下面的代碼塊,所述的烤麪包消息顯示正確的緯度(來自的strings.xml檢索
如何可以使用變量I設定緯度?
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!");
你檢查了什麼是intLat的值是正確的值你得到 – 2012-04-26 02:15:42