Everytime We try to get width or height from an Android layout or view we will get 0. That’s because during onResume and onCreate it’s still not available.
For getting that information, you could do something like this:
Just get the view tree observer from the layout and attach a listener to it. Now inside it, you can get its height or width, and you just have to deattach the global layout listener. Just note that for android sdk > 16 you must use mContainer.getViewTreeObserver().removeOnGlobalLayoutListener(this);