Пример #1
0
jchar JObject::CallCharMethod(IN const char* methodName, IN const char* sig, IN ...) {
	JNIEnv* env = mJNIEnvGetter.get();
	jmethodID id = GetMethodID_(env, mJObject, methodName, sig);
	va_list ap;
	va_start(ap, sig);
	jchar result = env->CallCharMethodV(mJObject, id, ap);
	va_end(ap);
	return result;
}
jchar CinderDelegate::callCharMethodOnJavaListener(const char *name, const char *sig, ...)
{
    JNIEnv *env;
    mJavaVM->GetEnv((void**)&env, JNI_VERSION_1_4);

    jclass cls = env->GetObjectClass(mJavaListener);
    jmethodID method = env->GetMethodID(cls, name, sig);

    va_list args;
    va_start(args, sig);
    jchar ret = env->CallCharMethodV(mJavaListener, method, args);
    va_end(args);

    return ret;
}