title: Android transparent SurfaceView clears to black
body: <p>I want to put a transparent SurfaceView on top of an ImageView. I have the following in the SurfaceView subclass constructor</p>
  
  <pre><code>setZOrderOnTop(true);    // necessary
  SurfaceHolder h = getHolder();
  h.setFormat(PixelFormat.TRANSPARENT);
  </code></pre>
  
  <p>I also have this in the beginning of the onDraw() function</p>
  
  <pre><code>canvas.drawColor( 0, PorterDuff.Mode.CLEAR );
  </code></pre>
  
  <p>Yet, all I get is a black background which blocks the image.</p>
  
  <p>Any ideas?</p>
  
  <p>PS, I also tried this instead of drawColor(), but to no avail</p>
  
  <pre><code>Paint paint = new Paint();
  paint.setXfermode(new PorterDuffXfermode(Mode.CLEAR));
  canvas.drawPaint(paint);
  paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
  </code></pre>