title: SurfaceView to Bitmap
body: <p>I am trying to convert my SurfaceView (camera preview) into a Bitmap for face detection on the fly. I am receiving a not null image but when I display it onto a view it appears to be plain black. Any ideas what might be the reason and how to proceed?</p>
  
  <p>(I believe it is difficult but not impossible to extract the bitmap from a SurfaceView - but nobody has posted any solution)</p>
  
  <pre><code>class BackgroundView extends SurfaceView implements SurfaceHolder.Callback {
  
  
          public BackgroundView(Context context) {
              super(context);
  
                      // ...
  
              setDrawingCacheEnabled(true);
          }
  
  
          // ...
      }
  
      private Runnable update = new Runnable() {
          public void run() {
  
                      // Following statement is sending a black/blank image
              faceView.updateFaces(backgroundView.getDrawingCache());
              mHandler.postDelayed(update, (long) (1000));
          }
      };
  </code></pre>