Implementing Parcelable
<p>I have implemented parcelable in many of my classes that only have String member variables. I am not sure how to do it for a class that has an ArrayList. What do I do in the constructor that takes in the source (Parcel)?</p>

<pre><code>public class Schedule {

private ArrayList&lt;Event&gt; allEvents;

 public Schedule(Parcel source) {

    }

public Schedule(){
    allEvents = new ArrayList&lt;Event&gt;();
}

//Getter
public ArrayList&lt;Event&gt; getAllEvents(){
    return allEvents;
}

public void addEvent(Event newEvent){
    allEvents.add(newEvent);
}

  public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(allEvents);
    }

        public static final Parcelable.Creator&lt;Schedule&gt; CREATOR = 
        new Parcelable.Creator&lt;Schedule&gt;() {

            @Override
            public Schedule createFromParcel(Parcel source) {
                return new Schedule(source);
            }

            @Override
            public Schedule[] newArray(int size) {
                return new Schedule[size];
            }
        };
</code></pre>

<p>}</p>
