장치를 회전 할 때 SupportMapFragment의 성능을 향상시키고 자합니다. 조각을 다시 만들어야하는 것처럼 보입니다. 이것에 대해서는 잘 모르겠지만 장치가 회전 할 때지도 타일을 다시로드해야합니다. 조각을 다시 인스턴스화하지 않고도 전체 맵 조각을 유지하고 재사용 할 수있는 성능 관점에서 이해할 수 있습니다. 이것에 대한 통찰력은 인정 될 것이다.재활용 안드로이드 맵 V2 SupportMap 회전 할 때의 조각
xml에 SupportMapFragment를 선언하고 API에 설명 된대로 SetupMapIfNeeded()를 사용합니다.
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the
// map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
이 Partick 어떤 곳을 가지고 있나요? –