BUG:
caused By:java.lang.IllegalStateException:setRenderer have already been called for this instance.
or nullpointer Error
Workaround:
Put Seteglcontextclientversion (2) and move to Setrenderer () front. The comment on the method is written to "If This method is called, it must are called before is setRenderer(Renderer) called.
”。
Expand:
and Setrender () before the method call order, is also fixed. For details, see the code comment as follows:
This method should is called once and only once in the life-cycle of a glsurfaceview.
(These methods are only available in Clsurfaceview and can only be called once)
The following Glsurfaceview methods can only be called before Setrenderer are called:
(Setrender, of course, including seteglcontextclientversion (2))
setEGLConfigChooser(boolean)
setEGLConfigChooser(EGLConfigChooser)
setEGLConfigChooser(int, int, int, int, int, int)
The following Glsurfaceview methods can only are called after Setrenderer are called:
(called after Setrender)
getRenderMode()
onPause()
onResume()
queueEvent(Runnable)
requestRender()
setRenderMode(int)
Opengl,android Considerations Initialization Sequence Nullpointer