The whole point of GLSurfaceView
is to manage things like that for you, so it's hard to make it do what you want.
One thing you can do is to wait until the GLSurfaceView
is created and then create a second EGL context in a share group. This is a bit awkward but can be made to work. In many ways it's simpler to just switch to SurfaceView
or TextureView
and manage EGL and threading yourself.
You can see various implementations in Grafika. "Show + capture camera" uses GLSurfaceView
with a shared EGLContext
, "Record GL app with FBO" uses SurfaceView
, "Play movie (TextureView)" uses a TextureView
, etc.