| 41 | |
| 42 | |
| 43 | static void CallJavaFunction_Void_Void( jobject a_Object, const std::string & a_FunctionName ) |
| 44 | { |
| 45 | //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "JNIEnv: %i Object: %i", g_CurrentJNIEnv, a_Object ); |
| 46 | jclass cls = g_CurrentJNIEnv->GetObjectClass( a_Object ); |
| 47 | //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "jclass: %i", cls ); |
| 48 | jmethodID mid = g_CurrentJNIEnv->GetMethodID( cls, a_FunctionName.c_str(), "()V"); // void a_FunctionName( String ) |
| 49 | //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "jmethodID: %i", mid ); |
| 50 | if (mid != 0) |
| 51 | { |
| 52 | //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "Going to call right NOW! %s", a_FunctionName.c_str() ); |
| 53 | g_CurrentJNIEnv->CallVoidMethod( a_Object, mid ); |
| 54 | } |
| 55 | else |
| 56 | { |
| 57 | __android_log_print(ANDROID_LOG_ERROR,"MCServer", "It was 0, derp" ); |
| 58 | } |
| 59 | } |