title: Screenshot is saving to SD card but is just black pixels
body: <p>I am trying to grab a screenshot and save to the SD card. The file is created and is about15kb but is just a rectangle of black.
  Any idea where I am going wrong?
  The following code is called inside my surfaceview class.
  w &amp; h were previously saved.</p>
  
  <pre><code>String mPath = Environment.getExternalStorageDirectory().toString() + "/" + "test.jpg";
  this.setDrawingCacheEnabled(true);
  Bitmap bitmap = Bitmap.createBitmap(w,h, Config.RGB_565);
  Canvas canvas = new Canvas(bitmap);
  this.draw(canvas);
  OutputStream fout = null;
  File imageFile;
  imageFile = new File(mPath);
  try {
  fout = new FileOutputStream(imageFile);
  bitmap.compress(Bitmap.CompressFormat.JPEG, 0, fout);
  fout.flush();
  fout.close();
  }
  </code></pre>