I know that doing view size calculations for placement is frowned up.
Android layout managers should place all views properly.
However there are some legitimate cases when s
The size of view cannot be calculated until its parent is calculated, but you can always force this calculation by calling measure(allowedWidth, allowedHeight) on it. Then getMeasuredWidth() will works.
see http://developer.android.com/reference/android/view/View.html#measure(int, int)