GetConstructorID() public static method

public static GetConstructorID ( IntPtr javaClass ) : IntPtr
javaClass IntPtr
return IntPtr
Exemplo n.º 1
0
        private void _AndroidJavaObject(string className, params object[] args)
        {
            this.DebugPrint("Creating AndroidJavaObject from " + className);
            bool flag = args == null;

            if (flag)
            {
                args = new object[1];
            }
            IntPtr jobject = AndroidJNISafe.FindClass(className.Replace('.', '/'));

            this.m_jclass = new GlobalJavaObjectRef(jobject);
            jvalue[] array = AndroidJNIHelper.CreateJNIArgArray(args);
            try
            {
                IntPtr constructorID = AndroidJNIHelper.GetConstructorID(this.m_jclass, args);
                IntPtr intPtr        = AndroidJNISafe.NewObject(this.m_jclass, constructorID, array);
                this.m_jobject = new GlobalJavaObjectRef(intPtr);
                AndroidJNISafe.DeleteLocalRef(intPtr);
            }
            finally
            {
                AndroidJNIHelper.DeleteJNIArgArray(args, array);
            }
        }
Exemplo n.º 2
0
 private void _AndroidJavaObject(string className, params object[] args)
 {
     this.DebugPrint("Creating AndroidJavaObject from " + className);
     if (args == null)
     {
         args = new object[1];
     }
     using (AndroidJavaObject androidJavaObject = AndroidJavaObject.FindClass(className))
     {
         this.m_jclass = AndroidJNI.NewGlobalRef(androidJavaObject.GetRawObject());
         jvalue[] jniArgArray = AndroidJNIHelper.CreateJNIArgArray(args);
         try
         {
             IntPtr localref = AndroidJNISafe.NewObject(this.m_jclass, AndroidJNIHelper.GetConstructorID(this.m_jclass, args), jniArgArray);
             this.m_jobject = AndroidJNI.NewGlobalRef(localref);
             AndroidJNISafe.DeleteLocalRef(localref);
         }
         finally
         {
             AndroidJNIHelper.DeleteJNIArgArray(args, jniArgArray);
         }
     }
 }
        public static IntPtr GetConstructorID(IntPtr javaClass)
        {
            string signature = "";

            return(AndroidJNIHelper.GetConstructorID(javaClass, signature));
        }
Exemplo n.º 4
0
        public static IntPtr GetConstructorID(IntPtr javaClass)
        {
            string empty = string.Empty;

            return(AndroidJNIHelper.GetConstructorID(javaClass, empty));
        }
Exemplo n.º 5
0
 public static IntPtr GetConstructorID(IntPtr jclass, object[] args)
 {
     return(AndroidJNIHelper.GetConstructorID(jclass, GetSignature(args)));
 }
 public static IntPtr GetConstructorID(IntPtr javaClass)
 {
     return(AndroidJNIHelper.GetConstructorID(javaClass, ""));
 }