mRootLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { mFragmentWidth = getView().getWidth(); mFragmentHeight = getView().getHeight(); if (mFragmentWidth > 0) { ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mFragmentWidth); mMapView.setLayoutParams(param..