title: Android - How to set width and height for customview in OnDraw() with Canvas?
body: <p>I am trying to set the Width and Height for a customview on which I use Canvas to draw.</p>
  <p>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.</p>
  <p>Could some one help me where I am going wrong.</p>
  <p>Thanks</p>
  <pre><code>@Override
  protected void onMeasure(final int widthMeasureSpec,
                           final int heightMeasureSpec) {
       super.onMeasure(widthMeasureSpec, heightMeasureSpec);
       setMeasuredDimension(getMeasuredWidth(), getMeasuredHeight());
  }
  </code></pre>