From 3e9768b6e431efe641c01046abef3a3dd4a8c664 Mon Sep 17 00:00:00 2001 From: Adrian Dawid Date: Sun, 26 Oct 2014 17:47:40 +0100 Subject: [PATCH] Update GameSharing.cpp Solved Issue #1 --- C++/GameSharing.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/C++/GameSharing.cpp b/C++/GameSharing.cpp index 92d51da..c3f6dd5 100644 --- a/C++/GameSharing.cpp +++ b/C++/GameSharing.cpp @@ -196,3 +196,21 @@ bool GameSharing::IsGPGAvailable(){ wasGPGAvailableCalled = true; return tmp; } + + +void GameSharing::ExitGame(){ +#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID + JniMethodInfo t; + if (JniHelper::getStaticMethodInfo(t + , "org/cocos2dx/cpp.AppActivity" + , "exitGame" + , "()V")) + { + t.env->CallStaticVoidMethod(t.classID, t.methodID); + // Release + t.env->DeleteLocalRef(t.classID); + } +#else + Director::getInstance()->end(); +#endif +}