JNIEnv *env = activity->env;
jobject activity_obj = activity->clazz;
// Custom classes cannot be found directly - such a class needs to be loaded with Activity's ClassLoader.
// Get ClassLoader:
jclass activity_class = env->GetObjectClass(activity_obj);
jmethodID get_class_loader_mid = end->GetMethodID(activity_class, "getClassLoader", "()Ljava/lang/ClassLoader;");
jobject class_loader_obj = env->CallObjectMethod(activity_obj, get_class_loader_mid);
// Use the ClassLoader to load the custom class:
jclass class_loader_class = env->FindClass("java/lang/ClassLoader");
jmethodID find_class_mid = env->GetMethodID(class_loader_class, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
jstring custom_class_name = env->NewStringUTF("fully.qualified.name.of.CustomClass");
jclass custom_class = reinterpret_cast<jclass>(env->CallObjectMethod(class_loader_obj, find_class_mid, custom_class_name));
env->DeleteLocalRef(custom_class_name);
// Now custom_class can be passed to various 'Call<...>Method' calls.