RegisterNatives() public method

public RegisterNatives ( MonoJavaBridge.JniHandle clazz, JNINativeMethod methods, int nMethods ) : JNIResult
clazz MonoJavaBridge.JniHandle
methods JNINativeMethod
nMethods int
return JNIResult
コード例 #1
0
 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?");
     }
 }
コード例 #2
0
ファイル: JNINativeMethod.cs プロジェクト: zffl/androidmono
        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?");
                }
            }
        }