The easiest way is to use two activities, and just switch between them.
The trouble here is that ViewFlipper
can only affect the "view" part of the GLSurfaceView
, which is just a transparent hole. The surface where the GL rendering happens is composited separately, behind the layer with the view content, so it cannot be animated this way.
An example of using two activities in a GL game can be found in Android Breakout, which uses one activity for configuration and "start", and another for the game itself.
If you really want the ViewFlipper
animation you could render into a TextureView, but your app would have to handle a number of things that GLSurfaceView
does for you. TextureView
is also less efficient than SurfaceView
.