title: Android Canvas Clear with transparency
body: <p>I am trying to "erase" from a canvas.  Just as a VERY simple test of clearing a canvas, I have implemented the following:</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      super.onDraw(canvas);
      canvas.drawColor(Color.argb(140, 0, 0, 0));
      canvas.drawColor(0, Mode.CLEAR);
  }
  </code></pre>
  
  <p><code>Color.argb(140, 0, 0, 0)</code> sets the view this view is drawn over to be dimmed.  <code>drawColor(0, Mode.CLEAR)</code> makes the screen completely black, rather than removing the dimming applied earlier.  <a href="https://stackoverflow.com/questions/5729377/android-canvas-how-do-i-clear-delete-contents-of-a-canvas-bitmaps-livin">The idea was taken from here</a></p>