I am trying to set the Width and Height for a customview on which I use Canvas to draw.
Have noticed that onDraw() always sets to a default width and height, and not take the values as specified in layout xml or set using the onMeasure method.
Could some one help me where I am going wrong.
Thanks
@Override
protected void onMeasure(final int widthMeasureSpec,
final int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
}