Share via


SparseArray Constructors

Definition

Overloads

SparseArray()

Creates a new SparseArray containing no mappings.

SparseArray(Int32)

Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings.

SparseArray(IntPtr, JniHandleOwnership)

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

SparseArray()

Creates a new SparseArray containing no mappings.

[Android.Runtime.Register(".ctor", "()V", "")]
public SparseArray ();
Attributes

Remarks

Creates a new SparseArray containing no mappings.

Java documentation for android.util.SparseArray.SparseArray().

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

SparseArray(Int32)

Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings.

[Android.Runtime.Register(".ctor", "(I)V", "")]
public SparseArray (int initialCapacity);
[<Android.Runtime.Register(".ctor", "(I)V", "")>]
new Android.Util.SparseArray : int -> Android.Util.SparseArray

Parameters

initialCapacity
Int32
Attributes

Remarks

Creates a new SparseArray containing no mappings that will not require any additional memory allocation to store the specified number of mappings. If you supply an initial capacity of 0, the sparse array will be initialized with a light-weight representation not requiring any additional array allocations.

Java documentation for android.util.SparseArray.SparseArray(int).

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

SparseArray(IntPtr, JniHandleOwnership)

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

protected SparseArray (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Util.SparseArray : nativeint * Android.Runtime.JniHandleOwnership -> Android.Util.SparseArray

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