MCPcopy Create free account
hub / github.com/android/ndk-samples / CallObjectMethod

Method CallObjectMethod

teapots/common/ndk_helper/JNIHelper.cpp:551–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551jobject JNIHelper::CallObjectMethod(const char* strMethodName,
552 const char* strSignature, ...) {
553 if (activity_ == NULL) {
554 LOGI(
555 "JNIHelper has not been initialized. Call init() to initialize the "
556 "helper");
557 return NULL;
558 }
559
560 JNIEnv* env = AttachCurrentThread();
561 jmethodID mid =
562 env->GetMethodID(jni_helper_java_class_, strMethodName, strSignature);
563 if (mid == NULL) {
564 LOGI("method ID %s, '%s' not found", strMethodName, strSignature);
565 return NULL;
566 }
567
568 va_list args;
569 va_start(args, strSignature);
570 jobject obj = env->CallObjectMethodV(jni_helper_java_ref_, mid, args);
571 va_end(args);
572
573 return obj;
574}
575
576void JNIHelper::CallVoidMethod(const char* strMethodName,
577 const char* strSignature, ...) {

Callers 9

GetExceptionSummaryFunction · 0.80
InitMethod · 0.80
LoadTextureMethod · 0.80
LoadCubemapTextureMethod · 0.80
LoadImageMethod · 0.80
RetrieveClassMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected