title: Custom View not drawing itself
body: <p>I read different questions here about this topic, but I still can't find an answer. Feel free to close this question for any reason.</p>
  
  <p>I have a simple <code>Circle</code> class that extends <code>View</code>.</p>
  
  <p>The code for this class is:</p>
  
  <pre><code>public class ProgressCircle extends View {
      Paint mCirclePaint;
      float extRadius;
      float viewWidth, viewHeight;
      float centerX, centerY;
  
      public ProgressCircle(Context context, AttributeSet attrs) {
          super(context, attrs);
          setWillNotDraw(false);
          init();
      }
  
      @Override
      protected void onSizeChanged(int w, int h, int oldw, int oldh) {
          float xpad = (float) getPaddingLeft() + getPaddingRight();
          float ypad = (float) getPaddingTop() + getPaddingBottom();
          float ww = (float)w - xpad; float hh = (float)h - ypad;
          extRadius = Math.min(ww, hh) / 2;
  
          viewWidth = this.getWidth();
          viewHeight = this.getHeight();
          centerX = viewWidth / 2; centerY = viewHeight / 2;
  
          super.onSizeChanged(w, h, oldw, oldh);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
          super.onDraw(canvas);
          canvas.drawCircle(centerX, centerY, extRadius, mCirclePaint);
          canvas.drawText("ciao", 0, 0, mCirclePaint);    
      }
  
      private void init() {
          mCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
          mCirclePaint.setColor(0x666666);
          mCirclePaint.setStyle(Paint.Style.FILL_AND_STROKE);
      }
  </code></pre>
  
  <p>I confirmed that every method in this classed is called when the main activity is created (through the use of some <code>Log.d()</code>s). I added a <code>&lt;com.mypackage.Circle&gt;</code> element in my main activity's <code>LinearLayout</code> and after that I added a sample testing button.</p>
  
  <p>What I achieved is that the button is shown while my <code>Circle</code> isn't, but still the button (which in the <code>LinearLayout</code> comes after the <code>Circle</code>) is not the first element of the layout: that makes me think that something actually happens, but nothing gets drawn.</p>