title: onDraw being called in other custom views when calling invalidate
body: <p>I have two custom views that have the same methods and when I call <code>invalidate()</code> in one it calls the <code>onDraw</code> method in both. I tried several methods including <code>this.invalidate()</code> but it still calls it. The only way I can think of it working is adding a boolean to the other class to check it it was called for itself inside the <code>onDraw()</code>.</p>
  
  <h1>Custom View 1</h1>
  
  <pre><code>public void showPercentage(double percent, double out){
      cropx =  (int) percent;
      outof = (int) out;
      this.invalidate();
  }
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      if(cropx != 0){
      croppedBmp = Bitmap.createBitmap(drawGraph2, 0, 0, (drawGraph2.getWidth()*cropx/100), drawGraph2.getHeight());
      canvas.drawBitmap(croppedBmp, 0, 0, new Paint());
      croppedBmp.recycle();
      System.gc();
      Runtime.getRuntime().gc();
      }
  }
  </code></pre>
  
  <h1>Custom View 2</h1>
  
  <pre><code>protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      //System.out.print to check if its being called
      System.out.println("hey");
      Bitmap croppedBmp = Bitmap.createBitmap(drawGraph2);
      canvas.drawBitmap(croppedBmp, 0, 0, new Paint());
  }
  </code></pre>