共用方式為


WeakReference Constructors

Definition

Overloads

WeakReference(Object)

Creates a new weak reference that refers to the given object.

WeakReference(Object, ReferenceQueue)

Creates a new weak reference that refers to the given object and is registered with the given queue.

WeakReference(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

WeakReference(Object)

Creates a new weak reference that refers to the given object.

[Android.Runtime.Register(".ctor", "(Ljava/lang/Object;)V", "")]
public WeakReference (Java.Lang.Object? referent);
[<Android.Runtime.Register(".ctor", "(Ljava/lang/Object;)V", "")>]
new Java.Lang.Ref.WeakReference : Java.Lang.Object -> Java.Lang.Ref.WeakReference

Parameters

referent
Object

object the new weak reference will refer to

Attributes

Remarks

Creates a new weak reference that refers to the given object. The new reference is not registered with any queue.

Java documentation for java.lang.ref.WeakReference.WeakReference(T).

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

WeakReference(Object, ReferenceQueue)

Creates a new weak 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 WeakReference (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.WeakReference : Java.Lang.Object * Java.Lang.Ref.ReferenceQueue -> Java.Lang.Ref.WeakReference

Parameters

referent
Object

object the new weak reference will refer to

q
ReferenceQueue

the queue with which the reference is to be registered, or null if registration is not required

Attributes

Remarks

Creates a new weak reference that refers to the given object and is registered with the given queue.

Java documentation for java.lang.ref.WeakReference.WeakReference(T, java.lang.ref.ReferenceQueue<? super T>).

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

WeakReference(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected WeakReference (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Lang.Ref.WeakReference : nativeint * Android.Runtime.JniHandleOwnership -> Java.Lang.Ref.WeakReference

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

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.

Applies to