我是android新手,现在正在使用Google maps v2,我使用tabhost来显示Google map v2,在这个tabhost中我需要在不同的标签上显示两个Google maps v2.当我切换标签b/w两个包含地图的标签时,它会重叠.我不知道要克服这个问题.
//代码在这里用于两个选项卡
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
mMap.setMyLocationEnabled(true);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
//locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, MIN_TIME, MIN_DISTANCE, this);
Log.e("locamanager",""+locationManager);
Criteria criteria=new Criteria(); // object to retrieve provider
String provider = locationManager.getBestProvider(criteria, true);
Location location=locationManager.getLastKnownLocation(provider);
if(location!=null){
onLocationChanged(location);
}
locationManager.requestLocationUpdates(provider, 400, 1000, this);
}
@Override
public void onLocationChanged(Location location) {
latLng = new LatLng(location.getLatitude(), location.getLongitude());
Log.e("latlng",""+latLng);
cameraUpdate = CameraUpdateFactory.newLatLngZoom(latLng, 15);
mMap.animateCamera(cameraUpdate);
locationManager.removeUpdates(this);
new ReverseGeocodingTask(getBaseContext()).execute(latLng);
}
Run Code Online (Sandbox Code Playgroud)
有人有解决方案请帮帮我
感谢Advance
android android-maps google-maps-android-api-2 android-maps-v2