bool FJavaClassObject::CallMethod<bool>(FJavaClassMethod Method, ...)
{
	JNIEnv*	JEnv = FAndroidApplication::GetJavaEnv();
	va_list Params;
	va_start(Params, Method);
	bool RetVal = JEnv->CallBooleanMethodV(Object, Method.Method, Params);
	va_end(Params);
	VerifyException();
	return RetVal;
}
Exemple #2
0
jboolean JObject::CallBooleanMethod(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);
	jboolean result = env->CallBooleanMethodV(mJObject, id, ap);
	va_end(ap);
	return result;
}
jboolean CinderDelegate::callBooleanMethodOnJavaListener(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);
    jboolean ret = env->CallBooleanMethodV(mJavaListener, method, args);
    va_end(args);

    return ret;
}
Exemple #4
0
bool JNIHelper::CallBooleanMethod(jobject object, const char *strMethodName,
                                  const char *strSignature, ...) {
  bool b;
  if (activity_ == NULL) {
    LOGI("JNIHelper has not been initialized. Call init() to initialize the "
         "helper");
    return false;
  }

  JNIEnv *env = AttachCurrentThread();
  jclass cls = env->GetObjectClass(object);
  jmethodID mid = env->GetMethodID(cls, strMethodName, strSignature);
  if (mid == NULL) {
    LOGI("method ID %s, '%s' not found", strMethodName, strSignature);
    return false;
  }
  va_list args;
  va_start(args, strSignature);
  b = env->CallBooleanMethodV(object, mid, args);
  va_end(args);

  env->DeleteLocalRef(cls);
  return b;
}