Recreating assets after onResume()

After onPause is called for the GLSurfaceView the rendering surface is destroyed, along with all the textures, shaders and the like. On onResume() should the surface not be recreated and GLRenderer onSurfaceCreated called? However that is never called. I am using render when dirty.

• Are you calling GLSurfaceView.onResume() from the application's onResume()? – sam hocevar Dec 7 '11 at 13:48
• Yes, I am calling onResume() and onPause() – leonmajere Dec 7 '11 at 18:31

If you use this modified version of GLSurfaceView your rendering surface will not be destroyed:

I believe this is something the android framework does, as some devices / GPU's can't support multiple GL states and clearing any onPause() allows other apps to use openGL.
I just accept that and reload textures etc onResume(). If you keep your textures as bitmaps in memory as well as all your vertices etc, you should be able to minimise the amount of time it takes to reload after resumption.
Then again, I don't extend GLSurfaceView and do all my rendering in GLSurfaceView.Renderer