Esempio n. 1
0
        public static unsafe global::Java.Lang.Object Unmarshall(byte[] bytes, global::Android.OS.IParcelableCreator creator)
        {
            const string __id         = "unmarshall.([BLandroid/os/Parcelable$Creator;)Ljava/lang/Object;";
            IntPtr       native_bytes = JNIEnv.NewArray(bytes);

            try {
                JniArgumentValue *__args = stackalloc JniArgumentValue [2];
                __args [0] = new JniArgumentValue(native_bytes);
                __args [1] = new JniArgumentValue((creator == null) ? IntPtr.Zero : ((global::Java.Lang.Object)creator).Handle);
                var __rm = _members.StaticMethods.InvokeObjectMethod(__id, __args);
                return((Java.Lang.Object)global::Java.Lang.Object.GetObject <global::Java.Lang.Object> (__rm.Handle, JniHandleOwnership.TransferLocalRef));
            } finally {
                if (bytes != null)
                {
                    JNIEnv.CopyArray(native_bytes, bytes);
                    JNIEnv.DeleteLocalRef(native_bytes);
                }
                global::System.GC.KeepAlive(bytes);
                global::System.GC.KeepAlive(creator);
            }
        }
 public static unsafe global::Java.Lang.Object CreateParcelable(global::Android.OS.Parcel parcel, global::Android.OS.IParcelableCreator creator)
 {
     if (id_createParcelable_Landroid_os_Parcel_Landroid_os_Parcelable_Creator_ == IntPtr.Zero)
     {
         id_createParcelable_Landroid_os_Parcel_Landroid_os_Parcelable_Creator_ = JNIEnv.GetStaticMethodID(class_ref, "createParcelable", "(Landroid/os/Parcel;Landroid/os/Parcelable$Creator;)Landroid/os/Parcelable;");
     }
     try {
         JValue *__args = stackalloc JValue [2];
         __args [0] = new JValue(parcel);
         __args [1] = new JValue(creator);
         global::Java.Lang.Object __ret = (Java.Lang.Object)global::Java.Lang.Object.GetObject <global::Java.Lang.Object> (JNIEnv.CallStaticObjectMethod(class_ref, id_createParcelable_Landroid_os_Parcel_Landroid_os_Parcelable_Creator_, __args), JniHandleOwnership.TransferLocalRef);
         return(__ret);
     } finally {
     }
 }