Interface that must be implemented and provided as a public CREATOR field that generates instances of your Parcelable class from a Parcel.
| 109 | * field that generates instances of your Parcelable class from a Parcel. |
| 110 | */ |
| 111 | public interface Creator<T> { |
| 112 | /** |
| 113 | * Create a new instance of the Parcelable class, instantiating it |
| 114 | * from the given Parcel whose data had previously been written by |
| 115 | * {@link Parcelable#writeToParcel Parcelable.writeToParcel()}. |
| 116 | * |
| 117 | * @param source The Parcel to read the object's data from. |
| 118 | * @return Returns a new instance of the Parcelable class. |
| 119 | */ |
| 120 | public T createFromParcel(Parcel source); |
| 121 | |
| 122 | /** |
| 123 | * Create a new array of the Parcelable class. |
| 124 | * |
| 125 | * @param size Size of the array. |
| 126 | * @return Returns an array of the Parcelable class, with every entry |
| 127 | * initialized to null. |
| 128 | */ |
| 129 | public T[] newArray(int size); |
| 130 | } |
| 131 | /** |
| 132 | * Specialization of {@link Creator} that allows you to receive the |
| 133 | * ClassLoader the object is being created in. |
no outgoing calls
no test coverage detected