I have this neat function:
private void addMapFragment(){ if(!mapFragment.isAdded()){ FragmentTransaction ft = getFragmentManager().beginTransact
FragmentTransactions are committed asynchronously. Therefore, you need to call
FragmentTransactions
getFragmentManager().executePendingTransactions();
before you call
Fragment.isAdded();
That way, you can make sure that everything is up to date.