DaumMap does not support that two or more net.daum.mf.map.api.MapView objects exists at the same time

카카오맵 api를 사용하다가 A activity에서 B activity 이동하면서 아래와 같은 에러가 났습니다

DaumMap does not support that two or more net.daum.mf.map.api.MapView objects exists at the same time

그래서 블로그들을 찾아보는데 A activity 에서 Mapview를 동적으로 생성하고 삭제하는 작업을 해주는 방법이 있더군요

image

----------------해당 소스코드랍니다-----------------------------
A activity
private CoordinatorLayout coord; //맵을 생성하기 위해 있는 parents View
private RelativeLayout mapViewContainer; //맵이 올라가는 container View

//인텐트가 넘어가는 부분에 추가///
coord.removeView(rel_map);

//////////////////////////////
@Override
protected void onResume() {
super.onResume();
if (coord.getChildAt(0)==null){
try{
mapViewContainer= new RelativeLayout(MapActivity.this);
mapViewContainer.setLayoutParams(new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
coord.addView(rel_map);
mapView = new MapView(MapActivity.this);
***
mapViewContainer.addView(mapView);

    }catch (RuntimeException re){
        Log.e("MapActivity","onResume : "+String.valueOf(re));
    }
}

}


B activity
@Override
public void finish() {
mapViewContainer.removeView(mapView);
super.finish();
}

이때 여기서 rel_map은 무엇을 가리키는걸까요??
B액티비티의 맵뷰인가요?
액티비티가 바뀌면서 지도를 삭제했다가 다시 여는 방법은 어떤식으로 이루어지는지 모르겠습니다.

화면 이동하는 코드 밑줄과 해당 onPause()에

mapViewContainer.removeAllViews();

이 코드 추가해줬더니 잘 돌아갑니다!!
A, B 둘 다 해줬어요