我正在寫應用程序在其中我使用GLSurfaceView繪製顯示形狀。問題是我想暫停繪圖或停止繪圖並再次恢復它.GLSurfaceView setRenderer在生命週期中只調用一次的application.OnDrawFrame是GLSurfaceView級操作系統的被覆蓋的功能,我不能禁用it.So我應該怎麼去停止/暫停圖紙和恢復again.I正在嘗試繪製如下:停止OnDrawFrame的Android GLSurfaceView
mGLSurfaceView = new GLSurfaceView(mContext);
mRelativeLayout.addView(mGLSurfaceView,mRelativeLayout.getLayoutParams());
mGLSurfaceView.setEGLContextClientVersion(2);
mGLSurfaceView.setRenderer(new LessonFiveRenderer(mContext));
,我試圖暫停/停止如下:
mGLSurfaceView.onPause();
mGLSurfaceView.getHolder().getSurface().release();
mGLSurfaceView.setVisibility(View.INVISIBLE);
mGLSurfaceView.destroyDrawingCache();
//mRelativeLayout.destroyDrawingCache();
mGLSurfaceView.invalidate();
mGLSurfaceView.clearAnimation();
mGLSurfaceView.postInvalidate();
mRelativeLayout.removeView(mGLSurfaceView);
mRelativeLayout.destroyDrawingCache();
//mRelativeLayout.removeAllViewsInLayout();
mRelativeLayout.invalidate();
但問題是繪圖不斷髮生在後臺。我該如何去停止繪圖。