I try to initialize GLES with EGL (because I want to draw from the main thread
instead of using a Renderer and drawing from inside onDrawFrame). I get the error: \"Make sure the
The check valid for surface should be did when surface is created. So, surface.isValid() should be called in onSurfaceCreated or onSurfaceChanged, obviously, you should add surfaceholder.callback.