mMapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentByTag(MAP_FRAGMENT_TAG);
// We only create a fragment if it doe
I solved this problem when I put this code:
@Override
public void onPause() {
Fragment fragment = (getFragmentManager().findFragmentById(R.id.map_tab));
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.remove(fragment);
ft.commit();
super.onPause();
}
or I put this code in onCreate
if (mView != null) {
ViewGroup parent = (ViewGroup) mView.getParent();
if (parent != null) {
parent.removeView(mView);
}
}
try {
mView = inflater.inflate(R.layout.tab_map_layout, container, false);
} catch (InflateException e) {
}