title: onDraw doesn't get called on custom view?
body: <p>I'm trying to draw a rounded rect with a specific color, but i'm getting nothing. 
  I've already done lots of googling, and found some questions like this and read them all. However, none of them solved my problem. Why my <code>onDraw</code> method is never called?</p>
  
  <p>Any help is appreciated.</p>
  
  <pre><code>public class RoundedTagItem extends RelativeLayout {
  
      Context ctx;
      String colorString;
      int color;
  
      public RoundedTagItem(Context context) {
          super(context);
          this.ctx = context;
          color = Color.WHITE;
          this.setWillNotDraw(false);
          this.setPadding(10, 0, 10, 0);
      }
  
      public RoundedTagItem(Context context, String color) {
          super(context);
          this.ctx = context;
          this.colorString = color;
          this.setWillNotDraw(false);
          this.setPadding(10, 0, 10, 0);
      }
  
      @Override
      protected void onDraw(Canvas canvas) {
  
         if(colorString != null)
               color = Color.parseColor("#" + colorString);
  
         int rectValue = 35;
         Log.d("Rounded", "rectValue: " + rectValue);
         RectF rect1 = new RectF(0, 0, rectValue, rectValue);
  
         Paint paint = new Paint();
         paint.setStrokeWidth(1);
         paint.setStrokeCap(Paint.Cap.ROUND);
         paint.setStyle(Paint.Style.FILL);
         paint.setAntiAlias(true);
         paint.setColor(color);
  
         canvas.save();
         canvas.drawRoundRect(rect1, 10, 10, paint);
         canvas.restore();
  
         super.onDraw(canvas);
      }
  
      public void ChangeBackgroundColor(String colorString) {
          color = Color.parseColor(colorString);
          invalidate();
      }
  
  }
  </code></pre>
  
  <p>And then I put icons on this custom view on my main class:</p>
  
  <pre><code>// add category items to view
  LinearLayout categories = (LinearLayout) findViewById(R.id.detailTagImagesLayout);
  for(int i = 0; i &lt; item.getCategoryItems().size(); i++) {
  
      RoundedTagItem v = null;
      if(i == 0) 
          v = new RoundedTagItem(DetailActivity.this, 
                             item.getCategoryItems().get(i).getColorCode());
      else 
          v = new RoundedTagItem(DetailActivity.this);            
  
      ImageView img = new ImageView(DetailActivity.this);
      img.setImageDrawable(Drawable.createFromPath(
                       item.getCategoryItems().get(i).getLightIconUrl()));
      v.addView(img);
  
      v.setTag(i);
      v.setOnClickListener(new TagClickListener());               
  
      categories.addView(v);
  }
  </code></pre>