Share via


Parcel.ReadParcelableList Method

Definition

Overloads

ReadParcelableList(IList, ClassLoader, Class)

Same as #readParcelableList(List, ClassLoader) but accepts clazz parameter as the type required for each item.

ReadParcelableList(IList, ClassLoader)

Read the list of Parcelable objects at the current data position into the given list.

ReadParcelableList(IList, ClassLoader, Class)

Same as #readParcelableList(List, ClassLoader) but accepts clazz parameter as the type required for each item.

[Android.Runtime.Register("readParcelableList", "(Ljava/util/List;Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/util/List;", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public System.Collections.IList ReadParcelableList (System.Collections.IList list, Java.Lang.ClassLoader? cl, Java.Lang.Class clazz);
[<Android.Runtime.Register("readParcelableList", "(Ljava/util/List;Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/util/List;", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
member this.ReadParcelableList : System.Collections.IList * Java.Lang.ClassLoader * Java.Lang.Class -> System.Collections.IList

Parameters

list
IList
clazz
Class

Returns

Attributes

Remarks

Same as #readParcelableList(List, ClassLoader) but accepts clazz parameter as the type required for each item.

<b>Warning: </b> if the list contains items implementing the Parcelable interface, the class that implements Parcelable has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, Class#getEnclosingClass() has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated #readParcelableList(List, ClassLoader) instead.

Java documentation for android.os.Parcel.readParcelableList(java.util.List<T>, java.lang.ClassLoader, java.lang.Class<? extends 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

ReadParcelableList(IList, ClassLoader)

Read the list of Parcelable objects at the current data position into the given list.

[Android.Runtime.Register("readParcelableList", "(Ljava/util/List;Ljava/lang/ClassLoader;)Ljava/util/List;", "", ApiSince=29)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })]
public System.Collections.IList ReadParcelableList (System.Collections.IList list, Java.Lang.ClassLoader? cl);
[<Android.Runtime.Register("readParcelableList", "(Ljava/util/List;Ljava/lang/ClassLoader;)Ljava/util/List;", "", ApiSince=29)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })>]
member this.ReadParcelableList : System.Collections.IList * Java.Lang.ClassLoader -> System.Collections.IList

Parameters

list
IList

Returns

Attributes

Remarks

Read the list of Parcelable objects at the current data position into the given list. The contents of the list are replaced. If the serialized list was null, list is cleared.

This member is deprecated. Use the type-safer version #readParcelableList(List, ClassLoader, Class) starting from Android Build.VERSION_CODES#TIRAMISU. Also consider changing the format to use #readTypedList(List, Parcelable.Creator) if possible (eg. if the items' class is final) since this is also more performant. Note that changing to the latter also requires changing the writes.

Java documentation for android.os.Parcel.readParcelableList(java.util.List<T>, java.lang.ClassLoader).

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