Class ParcelExtensions

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • readSupportList

         final static <T extends Parcelable> List<T> readSupportList(Parcel $self, List<T> list, Class<T> clazz)

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

        <p><b>Note: </b> This method will use the latest APIs introduced with [Build.VERSION_CODES#TIRAMISU], and will fall back on the older APIs on previous versions.
        Parameters:
        list - A list where the Parcelable objects at the current data position will be added.
        clazz - The object type required for each item.
        Returns:

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

      • readSupportParcelable

         final static <T extends Parcelable> T readSupportParcelable(Parcel $self, ClassLoader classLoader, Class<T> clazz)

        Reads a new Parcelable from the parcel. The given class loader will be used to load any enclosed Parcelables. If it is null, the default class loader will be used.

        <p><b>Note: </b> This method will use the latest APIs introduced with [Build.VERSION_CODES#TIRAMISU], and will fall back on the older APIs on previous versions.
        Parameters:
        classLoader - A ClassLoader from which to instantiate the Parcelable object, or null for the default class loader.
        clazz - The object type required for each item.
        Returns:

        The newly created Parcelable, or null if a null object has been written.