I am using a GLSurfaceView (sdk version 7) in RENDERMODE_WHEN_DIRTY. The documentation says I need to call onPause/onResume, but it works fine without it, so I am wondering. Is it required? What can happen if I don’t?
I am using a GLSurfaceView (sdk version 7) in RENDERMODE_WHEN_DIRTY. The documentation says I
Share
The implementation of GLSurfaceView’s onPause looks like this:
You can see (and the documentation states) that it pauses the rendering thread. This causes an internal call in the GLThread to stopEglLocked which looks like this:
So you can see it destroys the surface which is an expensive system resource, and causes thread to wait(), which also saves system resources, cpu, baterry, etc.
So, calling GLSurfaceView’s onPause and onResume is definitely required.