Skip to content
This repository has been archived by the owner on Apr 2, 2023. It is now read-only.

Commit

Permalink
Update GameSharing.cpp
Browse files Browse the repository at this point in the history
Solved Issue #1
  • Loading branch information
dwd31415 committed Oct 26, 2014
1 parent 547ba0b commit 3e9768b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions C++/GameSharing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 3e9768b

Please sign in to comment.