readSupportList

fun <T : Parcelable> Parcel.readSupportList(list: List<T>, clazz: Class<T>): List<T>

Reads into the given list items containing a particular object type that were written with Parcel.writeTypedList at the current Parcel.dataPosition. The list must have previously been written via Parcel.writeTypedList with the same object type.

Note: This method will use the latest APIs introduced with [Build.VERSION_CODES#TIRAMISU], and will fall back on the older APIs on previous versions.

Return

A newly created List containing objects with the same data as those that were previously written.

Parameters

list

A list where the Parcelable objects at the current data position will be added.

clazz

The object type required for each item.