title: Custom-view button onDraw() method does not draw
body: <p>If I extend a button and override the <code>onDraw</code> method to draw something for example a circle and in XML layout file use: </p>
  
  <pre><code>&lt;view class = "com.example.button.MainActivity$MyButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
  /&gt;
  </code></pre>
  
  <p>the circle appears but if I use this</p>
  
  <pre><code>&lt;Button class = "com.example.button.MainActivity$MyButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
  /&gt;
  </code></pre>
  
  <p>Instead, nothing except the default rectangular view for button appears.
  why?
  The custom button class implementation is in 
  <a href="https://stackoverflow.com/questions/24573667/extending-android-button-by-using-ondraw">extending android button by using onDraw</a>
  and the <code>onDraw()</code> method is:</p>
  
  <pre><code>protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      Paint paint = new Paint();
      paint.setColor(Color.BLUE);
      paint.setStrokeWidth(10);
      paint.setStyle(Style.FILL);
      int width = canvas.getWidth();
      int height = canvas.getHeight();
      canvas.drawCircle(width/2, height/2, height/3, paint);
  } 
  </code></pre>