findFragmentById always returns a null
问题 I'm using an actionbar in navigation mode in the mainActivity. Different tabs has different layouts, and on one of these tabs, I embed a layout which has a MapFragment inside. With the following code, the app works well, the mapFragments works fine, the tabs works fine. However, once I want to get access the mapFragment embeded in myFragment use getFragmentManager().findFragmentById(R.id.map_add), I always get null. I've tried using FragmentManager and FragmentTransaction to add myfragment