//======================= C++ 调用 java ===========================
static void goToLogin();
void JniFunction::goToLogin()
{ JniMethodInfo t; if (JniHelper::getStaticMethodInfo(t, "org/cocos2dx/cpp/ParallelSdkManager", "goToLogin", "()V")) { t.env->CallStaticVoidMethod(t.classID, t.methodID); t.env->DeleteLocalRef(t.classID); }}
public static void goToLogin(){
try{ System.out.println("goToLogin"); AppActivity sdkActivity = AppActivity.getActivity(); sdkActivity.testLogin(); }catch(Exception e){ e.printStackTrace(); } }
public void testLogin(){
try { System.out.println("--------testLogin-----9999998 88888888888 222222222222222 ------"); this.runOnUiThread(new Runnable(){@Override
public void run() { // TODO Auto-generated method stub System.out.println("second part was called ***************"); platform.pwLogin(AppActivity.this, AppActivity.this); } }); //} } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }//===================java调用C++ =====================
JniFunction.showHintForPay();
public static native void showHintForPay();
.h(C++)
//显示付费成功提示语JNIEXPORT void JNICALL Java_org_cocos2dx_cpp_JniFunction_showHintForPay();JNIEXPORT void JNICALL Java_org_cocos2dx_cpp_JniFunction_showHintForPay()
{ //do your things}