Merge pull request #8969 from kaylyun/v3

BUGFIX:SOMETIMES APP DIRECTLY AT THE STARTUP
This commit is contained in:
minggo 2014-11-05 17:58:28 +08:00
commit 7565b9b1eb
1 changed files with 5 additions and 3 deletions

View File

@ -17,9 +17,11 @@ extern "C" {
}
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnPause() {
Application::getInstance()->applicationDidEnterBackground();
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
if (Director::getInstance()->getOpenGLView()) {
Application::getInstance()->applicationDidEnterBackground();
cocos2d::EventCustom backgroundEvent(EVENT_COME_TO_BACKGROUND);
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&backgroundEvent);
}
}
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() {