Merge pull request #6958 from Dhilan007/v3

fixed EVENT_COME_TO_BACKGROUND has not been sent on android.
This commit is contained in:
minggo 2014-06-03 18:16:04 +08:00
commit e33871db9a
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "base/CCIMEDispatcher.h"
#include "base/CCDirector.h"
#include "base/CCEventType.h"
#include "base/CCEventCustom.h"
#include "../CCApplication.h"
#include "platform/CCFileUtils.h"
#include "JniHelper.h"
@ -16,6 +17,8 @@ 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);
}
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnResume() {