public static IntPtr ToLocalJniHandle(ICollection items) { if (items == null) { return(IntPtr.Zero); } var s = items as JavaSet; if (s != null) { return(JNIEnv.ToLocalJniHandle(s)); } using (s = new JavaSet(items)) return(JNIEnv.ToLocalJniHandle(s)); }
public static ICollection FromJniHandle(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) { return(null); } IJavaObject inst = (IJavaObject)Java.Lang.Object.PeekObject(handle); if (inst == null) { inst = new JavaSet(handle, transfer); } else { JNIEnv.DeleteRef(handle, transfer); } return((ICollection)inst); }
public static IntPtr ToLocalJniHandle(ICollection items) { if (items == null) return IntPtr.Zero; var s = items as JavaSet; if (s != null) return JNIEnv.ToLocalJniHandle (s); using (s = new JavaSet (items)) return JNIEnv.ToLocalJniHandle (s); }
public static ICollection FromJniHandle(IntPtr handle, JniHandleOwnership transfer) { if (handle == IntPtr.Zero) return null; IJavaObject inst = Java.Lang.Object.PeekObject (handle); if (inst == null) inst = new JavaSet (handle, transfer); else JNIEnv.DeleteRef (handle, transfer); return (ICollection) inst; }