title: Android Class Parcelable with ArrayList
body: <p>I have an android project where I have a class. In that class is an <code>ArrayList&lt;Choices&gt;</code>. I will be getting some XML, parsing it out, then making objects out of it which I will be passing to another activity. I'm choosing Parcelable for this. </p>
  
  <p>Is Parcelable a good choice? Am I doing everything correctly? I'm not familiar really with Parcelable. My ArrayList is of another class that I made within this class. Will it properly pass that ArrayList of objects to the Parcel with it not extending Parcelable and stuff? </p>
  
  <pre><code>import java.util.ArrayList;
  import android.os.Parcel;
  import android.os.Parcelable;
  import android.support.v4.os.ParcelableCompat;
  
  public class Question implements Parcelable{
  
  
  String id;
  String text;
  String image;
  ArrayList&lt;Choices&gt; CHOICES;
  
  
  public Question(String id, String text, String image) {
      super();
      this.id = id;
      this.text = text;
      this.image = image;
  }
  
  public String getId() {
      return id;
  }
  
  public void setId(String id) {
      this.id = id;
  }
  
  public String getText() {
      return text;
  }
  
  public void setText(String text) {
      this.text = text;
  }
  
  public String getImage() {
      return image;
  }
  
  public void setImage(String image) {
      this.image = image;
  }
  
  @Override
  public String toString() {
      return "Question [id=" + id + ", text=" + text + ", image=" + image
              + "]";
  }
  
  
  
  
  // Answer Choices class
  class Choices {
  
      boolean isCorrect;
      String choice;
  
      public Choices(boolean isCorrect, String choice) {
          this.isCorrect = isCorrect;
          this.choice = choice;
      }
  
      public String getChoice() {
          return choice;
      }
  
      public boolean getIsCorrect() {
          return isCorrect;
      }
  
      @Override
      public String toString() {
          return "Choices [isCorrect=" + isCorrect + ", choice=" + choice
                  + "]";
      }
  
  }
  
  
  public static final Parcelable.Creator&lt;Question&gt; CREATOR = new Parcelable.Creator&lt;Question&gt;() {
  
      @Override
      public Question createFromParcel(Parcel in) {
          return new Question(in);
      }
  
      @Override
      public Question[] newArray(int size) {
          return new Question[size];
      }
  
  };
  
  @Override
  public int describeContents() {
      // TODO Auto-generated method stub
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel dest, int flags) {
  
      dest.writeString(id);
      dest.writeString(text);
      dest.writeString(image);
      dest.writeList(CHOICES);
  
  }
  
  private Question(Parcel in) {
      this.id = in.readString();
      this.text = in.readString();
      this.image = in.readString();
      this.CHOICES = in.readArrayList(Choices.class.getClassLoader());
  }
  
  }
  </code></pre>
  
  <p>Thanks for any help!</p>