// int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); // int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); // inflate.measure(w, h); // int width = inflate.getMeasuredWidth(); // int height = inflate.getMeasuredHeight();