From b4df3afc703097ca5ba385b509b9ebf0a400f0ea Mon Sep 17 00:00:00 2001 From: Andriy Chaika Date: Mon, 10 Feb 2014 19:35:26 +0200 Subject: [PATCH] Android Flickering Bug Fix When the new Activity is launched the screen starts flickering (Two nearest frames are replacing each other all the time). This fix stops flickering. More: http://www.cocos2d-x.org/forums/6/topics/34686 --- .../java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java index 731f7e3289d8..f071fe8ff7b2 100644 --- a/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java +++ b/cocos2dx/platform/android/java/src/org/cocos2dx/lib/Cocos2dxGLSurfaceView.java @@ -158,7 +158,9 @@ public void setCocos2dxEditText(final Cocos2dxEditText pCocos2dxEditText) { @Override public void onResume() { super.onResume(); - + + this.setRenderMode(RENDERMODE_CONTINUOUSLY); + this.queueEvent(new Runnable() { @Override public void run() { @@ -175,7 +177,9 @@ public void run() { Cocos2dxGLSurfaceView.this.mCocos2dxRenderer.handleOnPause(); } }); - + + this.setRenderMode(RENDERMODE_WHEN_DIRTY); + //super.onPause(); }