title: How to get an EGL display/context to a specific GLSurfaceView
body: <p>This is a follow up to <a href="https://stackoverflow.com/questions/6509588/egl-vs-gles-2-0-on-android-e-g-java">my original Question</a>, which was probably too broad (whereas this one is probably too specific but maybe I can apply Newton's Method).<br>
  <br>
  My specific situation is: OpenGL ES 2.0, on Android, using only Java (no JNI/Native code).<br>
  <br>
  I am trying to understand how EGL and Android's GLES implimentation work together (or don't). I am having trouble because the EGL interface(API) does not seem well suited to Android's Java centric, Activity based OS.<br>
  <br>
  As a specific example: I have subclassed GLSurfaceView and create an instance using an XML layout and then use <code>findViewById()</code> to retrieve a reference. Using this approach I have the <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/GLES20TriangleRenderer.html" rel="nofollow noreferrer">textured triangle example</a> working (GLES 2.0 on Android 2.2, API level 8). This example does not use EGL. As a learning exercise I wanted to re-write it using EGL.<br>
  <br>
  All the examples I can find use <code>eglGetDisplay()</code> and <code>eglInitialize()</code>, and create a context in puff of greasy black smoke. None of the examples, references and questions I have found apply specifically to ES2.0/EGL/Android/Java. Am I completely missing something? <a href="https://stackoverflow.com/questions/6365366/how-to-properly-initialize-and-terminate-egl-on-android">This question</a> is related (I think) but does not have any responses and the example used in <a href="https://rads.stackoverflow.com/amzn/click/com/0321502795" rel="nofollow noreferrer" rel="nofollow noreferrer">the ES 2.0 Programming Guide</a> is a stand alone C implementation.</p>