Skip to content

Commit c9e4cb2

Browse files
authored
standardize pause & resume logic on GLSurfaceView (#19256)
1 parent 00cad6c commit c9e4cb2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ public void init() {
287287

288288
// Cocos2dxGLSurfaceView
289289
this.mGLSurfaceView = this.onCreateView();
290+
this.mGLSurfaceView.setPreserveEGLContextOnPause(true);
290291

291292
// ...add to FrameLayout
292293
mFrameLayout.addView(this.mGLSurfaceView);

cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void run() {
199199
}
200200
});
201201
this.setRenderMode(RENDERMODE_WHEN_DIRTY);
202-
//super.onPause();
202+
super.onPause();
203203
}
204204

205205
@Override

0 commit comments

Comments
 (0)