title: In Android FingerPaint demo how can I erase drawn paths
body: <p>I've been trying to alter the Android (v3.0 Honeycomb) API Demo FingerPaint (API >= 11) to include a working erase option that removes the last drawn path.  </p>
  
  <p>The erase in the API demo doesnt work well, in v3.0 is crashes, in v3.1 is draws a black box while only partially erasing the path (a bug has been raised not sure if it has been resolved in v3.2 [not out for Xoom device in UK]).</p>
  
  <p>My code is as follows:</p>
  
  <pre><code>public void eraseLastPath() {
      if (!mPaths.isEmpty()) {
          mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
          mCanvas.drawPath(mPaths.pop(), mPaint);
          invalidate();
      }
  }
  </code></pre>
  
  <p>This somewhat works but leaves an outline of the drawn path on the canvas. e.g.</p>
  
  <p>this:
  <img src="https://i.stack.imgur.com/y1hUy.png" alt="enter image description here"></p>
  
  <p>is erased to look like this:
  <img src="https://i.stack.imgur.com/z8enk.png" alt="enter image description here"></p>
  
  <p>What am I missing? Is there a better way to erase paths?</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>Thanks</p>
  
  <p>Joe</p>