我已将数据库中的纬度和经度存储为字符串,例如 23.563987,120.761719
我怎样才能将它们修剪成两个单独的整数,以便它可以适合我的代码?谢谢!
[对不起,我是java新手......]
我的地图代码如下:
GooglePlayServicesUtil
.isGooglePlayServicesAvailable(getApplicationContext());
mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mMap.addMarker(new MarkerOptions().position(
new LatLng(23.563987,120.761719)).title("Marker"));
mMap.setMyLocationEnabled(true);
CameraUpdate center = CameraUpdateFactory.newLatLng(new LatLng(
23.563987,120.761719));
CameraUpdate zoom = CameraUpdateFactory.zoomTo(15);
mMap.moveCamera(center);
mMap.animateCamera(zoom);