public RegisterNatives ( MonoJavaBridge.JniHandle clazz, |
||
clazz | MonoJavaBridge.JniHandle | |
methods | ||
nMethods | int | |
Результат | JNIResult |
public static unsafe void Register(List<JNINativeMethod> registrations, JniHandle clazz, JNIEnv env) { JNINativeMethod[] methods = registrations.ToArray(); JNIResult res = env.RegisterNatives(clazz, methods, methods.Length); if (res!=JNIResult.JNI_OK) { throw new JNIException("Can't bind native methods to class. Is it in system classloader?"); } }
public static unsafe void Register(List <JNINativeMethod> registrations, JniHandle clazz, JNIEnv env) { JNINativeMethod[] methods = registrations.ToArray(); fixed(JNINativeMethod *m = &(methods[0])) { JNIResult res = env.RegisterNatives(clazz, m, methods.Length); if (res != JNIResult.JNI_OK) { throw new JNIException("Can't bind native methods to class. Is it in system classloader?"); } } }