Restart GlSurfaceView On Button Click
1 answer
It looks like you just want to reload the data and not recreate the textures after the user navigates back to your application. In this case, create a method in your renderer that is public, such as setResetFlag (). In this method, you are setting the boolean variable reset. In the onDrawFrame method, check if the flag is set and reload your textures / reset your state if it is set (resetting its state back to its nominal reset state). This way you offload the work to the openGL thread and keep the UI nice and responsive.
0
source to share