Share via


Parcel.WriteTypedSparseArray(SparseArray, Int32) Method

Definition

Flatten a SparseArray containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed.

[Android.Runtime.Register("writeTypedSparseArray", "(Landroid/util/SparseArray;I)V", "", ApiSince=29)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })]
public void WriteTypedSparseArray (Android.Util.SparseArray? val, int parcelableFlags);
[<Android.Runtime.Register("writeTypedSparseArray", "(Landroid/util/SparseArray;I)V", "", ApiSince=29)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })>]
member this.WriteTypedSparseArray : Android.Util.SparseArray * int -> unit

Parameters

val
SparseArray

The list of objects to be written.

parcelableFlags
Int32

The parcelable flags to use.

Attributes

Remarks

Flatten a SparseArray containing a particular object type into the parcel at the current dataPosition() and growing dataCapacity() if needed. The type of the objects in the array must be one that implements Parcelable. Unlike the generic #writeSparseArray(SparseArray) method, however, only the raw data of the objects is written and not their type, so you must use the corresponding #createTypedSparseArray(Parcelable.Creator).

Java documentation for android.os.Parcel.writeTypedSparseArray(android.util.SparseArray<T>, 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