title: How to get the bitmap image from a GLSurfaceView
body: <p>I am doing the following to get the bitmap image that has been set to a <code>GLSurfaceView</code> object:</p>
  
  <pre><code>glView.setDrawingCacheEnabled(true);
  glView.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
          View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
  glView.layout(0, 0, glView.getMeasuredWidth(), glView.getMeasuredHeight());
  
  glView.buildDrawingCache(true);
  Bitmap tmpbm = Bitmap.createBitmap(glView.getDrawingCache());
  glView.setDrawingCacheEnabled(false);
  </code></pre>
  
  <p>But <code>glView.getDrawingCache()</code> is returning me <code>null</code> in the above case, and hence it is crashing in the line <code>Bitmap tmpbm = Bitmap.createBitmap(glView.getDrawingCache());</code>
  Why am I getting null from there, and how do I tackle this issue? Also, is there a different / better way to achieve my goal? Any help would be highly appreciated.</p>