PhantomReference Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
PhantomReference(Object, ReferenceQueue) |
Creates a new phantom reference that refers to the given object and is registered with the given queue. |
PhantomReference(IntPtr, JniHandleOwnership) |
A constructor used when creating managed representations of JNI objects; called by the runtime. |
PhantomReference(Object, ReferenceQueue)
Creates a new phantom reference that refers to the given object and is registered with the given queue.
[Android.Runtime.Register(".ctor", "(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V", "")]
public PhantomReference (Java.Lang.Object? referent, Java.Lang.Ref.ReferenceQueue? q);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/Object;Ljava/lang/ref/ReferenceQueue;)V", "")>]
new Java.Lang.Ref.PhantomReference : Java.Lang.Object * Java.Lang.Ref.ReferenceQueue -> Java.Lang.Ref.PhantomReference
Parameters
- referent
- Object
the object the new phantom reference will refer to
the queue with which the reference is to be registered,
or null
if registration is not required
- Attributes
Remarks
Creates a new phantom reference that refers to the given object and is registered with the given queue.
It is possible to create a phantom reference with a null
queue, but such a reference is completely useless: Its get
method will always return null
and, since it does not have a queue, it will never be enqueued.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
PhantomReference(IntPtr, JniHandleOwnership)
A constructor used when creating managed representations of JNI objects; called by the runtime.
protected PhantomReference (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Lang.Ref.PhantomReference : nativeint * Android.Runtime.JniHandleOwnership -> Java.Lang.Ref.PhantomReference
Parameters
- transfer
- JniHandleOwnership
A JniHandleOwnershipindicating how to handle javaReference
Remarks
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.