I'm creating an Android application using openGL ES, and I have following problem:
When I minimize the application, then reopen it, onSurfaceChanged in my GLSurfaceView.Renderer is called 2 times.
I have the following code in onSurfaceChanged (and similar code in onSurfaceCreated,onDrawFrame):
Log.e("onSurfaceChanged",Integer.toString(width)+" "+Integer.toString(height));
So I get the following log:
onSurfaceCreated onSurfaceChanged 480 800 onDrawFrame onSurfaceChanged 480 800 onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame (...)
When I minimize, change screen orientation from portrait to landscape, then reopen, onSurfaceChanged is called 3 times. And the log is:
onSurfaceCreated onSurfaceChanged 480 800 onDrawFrame onSurfaceChanged 480 800 onDrawFrame onDrawFrame onDrawFrame onSurfaceChanged 800 480 onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame onDrawFrame (...)
My question: is this a bug? In my application or is an Android bug? There is a way to onSurfaceChanged being called just once? (because in onSurfaceCreated I'm executing code that slow down the application)
Thanks in advance