title: Custom view Canvas onDraw() doesnt draw anything
body: <p>I am trying to draw a oval using canvas, but it never gets drawn.
  Here is my code for the custom view. I have also used <code>setWillNotDraw(false)</code> still nothing gets drawn on the screen.</p>
  
  <pre class="lang-java prettyprint-override"><code>public class Myview extends View {
      Paint paint;
      RectF rect;
      public Myview(Context context) {
          super(context);
          init();
          setWillNotDraw(false);
      }
  
      public Myview(Context context, AttributeSet attrs) {
          super(context, attrs);
          init();
          setWillNotDraw(false);
      }
  
      public Myview(Context context, AttributeSet attrs, int defStyle) {
          super(context, attrs, defStyle);
          init();
          setWillNotDraw(false);
      }
  
      private void init() {
          rect = new RectF(0.1 f, 0.1 f, getWidth(), getHeight());
          paint = new Paint();
          paint.setShader(new LinearGradient(0.40 f, 0.0 f, 100.60 f, 100.0 f,
              Color.parseColor("#ffffff"),
              Color.parseColor("#Ffffff"),
              Shader.TileMode.CLAMP));
      }
  
      @Override
      protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  
          setMeasuredDimension(200, 200);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
          canvas.drawOval(rect, paint);
      }
  }
  </code></pre>
  
  <p>Any suggestions?</p>