diff --git a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp index 6e0a4326bf..39a06ae230 100644 --- a/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp +++ b/cocos/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp @@ -27,10 +27,17 @@ extern "C" { } JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() { + static bool firstTime = true; if (Director::getInstance()->getOpenGLView()) { - Application::getInstance()->applicationWillEnterForeground(); + // don't invoke at first to keep the same logic as iOS + // can refer to https://github.com/cocos2d/cocos2d-x/issues/14206 + if (!firstTime) + Application::getInstance()->applicationWillEnterForeground(); + cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); + + firstTime = false; } }