mirror of https://github.com/axmolengine/axmol.git
Issue 14206 (#16201)
* don't trigger applicationWillEnterForeground at first time to be the same as iOS * rename first to firstTime
This commit is contained in:
parent
5b3eae7be8
commit
cc14a06800
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue