Question: I have some problems pausing my application. I use separate thread for game logic. So I pause my thread but I don't know how to properly pause and recreate OpenGL view. Here's my code. It works but I think there might be memory leaks. Display is GLSurfaceView and Renderer is GLSurfaceView.Renderer.

```
@Override
public void onPause()
{
    super.onPause();
    display = null;
    game.pause();
    Game.texturesLoaded = false;
}

@Override
public void onResume()
{
    // TODO normal pause
    super.onResume();
    display = new Display(this);
    display.setRenderer(renderer);
    setContentView(display);
    game.resume();
}

```

Answer: 
Recreating any OpenGL related stuff should be done via [`onSurfaceCreated()`](http://developer.android.com/reference/android/opengl/GLSurfaceView.Renderer.html#onSurfaceCreated%28javax.microedition.khronos.opengles.GL10,%20javax.microedition.khronos.egl.EGLConfig%29).
It should be enough to simply call `display.onPause()` and `display.onResume()`. 
See the Activity Life-Cycle section of <http://developer.android.com/reference/android/opengl/GLSurfaceView.html>