I have a MapFragment and regular Fragments in my app. The problem is when I change between the fragments, the MapFragment is in the background. I have code to find if the MapFragment is there, but I need code to remove it.
Code:
FragmentMapView mapFragmentcheck = (FragmentMapView)getFragmentManager().findFragmentByTag("map");
if (mapFragmentcheck != null) {
Log.d("tag","max exists");
if (mapFragmentcheck.isVisible()) {
Log.d("tag","map is visble, remove it");
// Do remove here, but how?
}
}
else {
Log.d("tag","map does not exists");
}
Try this