我有一些暫停我的應用程序的問題。我爲遊戲邏輯使用單獨的線程。所以我暫停我的線程,但我不知道如何正確地暫停並重新創建OpenGL視圖。這是我的代碼。它的工作原理,但我認爲可能會有內存泄漏。顯示器是GLSurfaceView,渲染器是GLSurfaceView.Renderer。Android - 如何正確掛起OpenGL
@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();
}
嗯,沒有。不起作用。 – Fizzics 2012-02-18 14:16:02