title: Screenshot on android OpenGL ES application
body: <p>I have a basic openGL ES 20 application running with on a GLSurfaceView that has been added:</p>
  
  <pre><code>    GLSurfaceView view = new GLSurfaceView(this);
      view.setRenderer(new OpenGLRenderer());
      setContentView(view);
  </code></pre>
  
  <p>Basically I am trying get a screenshot with the following method:</p>
  
  <pre><code>private static Bitmap getScreenshot(View v)
      {
          Bitmap b = Bitmap.createBitmap(v.getWidth(), v.getHeight(),
                  Bitmap.Config.ARGB_8888);
          Canvas c = new Canvas(b);
          v.draw(c);
          return b;
      }
  </code></pre>
  
  <p>But it seems the bitmap is transparent. The view I am passing in is:</p>
  
  <pre><code>View content = m_rootActivity.getWindow().getDecorView().getRootView();
  </code></pre>
  
  <p>Anyone has a solution on how to get screenshot on openGL ES without resorting into going into the DrawFrame method which I have seen in other solutions.</p>
  
  <p>Maybe pass in the reference of the renderer? Any help would be appreciated.</p>
  
  <p>Update:
  I was exploring in rendering the bitmap from the onDrawFrame (<a href="https://stackoverflow.com/questions/21753519/display-black-screen-while-capture-screenshot-of-glsurfaceview">Display black screen while capture screenshot of GLSurfaceView</a>)</p>
  
  <p>However, I was wondering if there is a better solution since I won't have access to the renderer nor the surfaceview. I can pass in their reference but would like a solution where we can just capture the entire view like what was mentioned earlier.</p>