public static IntPtr NewReturnToJniRef(JniObjectReference value) { if (!value.IsValid) { return(IntPtr.Zero); } var l = value.NewLocalRef(); return(JniEnvironment.Runtime.ObjectReferenceManager.ReleaseLocalReference(JniEnvironment.CurrentInfo, ref l)); }
public JniLocalReference NewLocalRef() { var r = new JniObjectReference(DangerousGetHandle(), ReferenceType); return(new JniLocalReference(r.NewLocalRef().Handle)); }