Package android.os

Interface Parcelable

  • All Known Implementing Classes:
    Bundle, ParcelUuid, PersistableBundle

    public interface Parcelable
    Interface for classes whose instances can be written to and restored from a Parcel. Classes implementing the Parcelable interface must also have a non-null static field called CREATOR of a type that implements the Parcelable.Creator interface. See android.os.Parcelable documentation for reference.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static interface  Parcelable.ClassLoaderCreator<P>
      Specialization of Parcelable.Creator that allows you to receive the ClassLoader the object is being created in.
      static interface  Parcelable.Creator<P>
      Creator class.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CONTENTS_FILE_DESCRIPTOR
      Bit masks for use with describeContents(): each bit represents a kind of object considered to have potential special significance when marshaled.
      static int PARCELABLE_WRITE_RETURN_VALUE
      Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".
    • Field Detail

      • CONTENTS_FILE_DESCRIPTOR

        static final int CONTENTS_FILE_DESCRIPTOR
        Bit masks for use with describeContents(): each bit represents a kind of object considered to have potential special significance when marshaled.
        See Also:
        Constant Field Values
      • PARCELABLE_WRITE_RETURN_VALUE

        static final int PARCELABLE_WRITE_RETURN_VALUE
        Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".
        See Also:
        Constant Field Values
    • Method Detail

      • describeContents

        int describeContents()
        Describe the kinds of special objects contained in this Parcelable's marshaled representation.
        Returns:
        Bitmask of CONTENTS_* flags.
      • writeToParcel

        void writeToParcel​(Parcel dest,
                           int flags)
        Flatten this object in to a Parcel.
        Parameters:
        dest - The parcelable to write to.
        flags - Bitmask of PARCELABLE_WRITE_* flags.