title: Parcelable - ArrayList<String> NullPointerException
body: <p>I'm making my object parcelable so I can use it with <code>Intent</code>s. I'm getting a <code>NullPointerException</code> when, once received, I'm reading my object's content. Most exactly the content of my <code>ArrayList&lt;String&gt;</code>. When iterating over my <code>ArrayList&lt;String&gt;</code> it has <code>null</code> value in all positions, therefore my <code>NullPointerException</code>.</p>
  
  <p>Here's my <code>Parcelable</code> class:</p>
  
  <pre><code>public class PhoneBackup implements Parcelable{
  
  public Integer id;
  public Long ts;
  public String device_name;
  public String device_manufacturer;
  public String device_model;
  public Integer backup_contacts_count;
  public String description;
  public ArrayList&lt;String&gt; backup_contacts;
  
  public PhoneBackup()
  {
  
  }
  
  
  public PhoneBackup(Parcel pc){
  //      backup_contacts = new ArrayList&lt;String&gt;(); // Tried this way, still NPE
  
      id = pc.readInt();
      ts =  pc.readLong();
      device_name = pc.readString();
      device_manufacturer = pc.readString();
      device_model = pc.readString();
      backup_contacts_count = pc.readInt();
      description = pc.readString();
  //      pc.readStringList(backup_contacts); // Tried this way, still NPE
      backup_contacts = pc.createStringArrayList();
  }
  
  // (getters and setters)
  
  @Override
  public int describeContents() {
      return 0;
  }
  
  @Override
  public void writeToParcel(Parcel dest, int flags) {
      dest.writeInt(id);
      dest.writeLong(ts);
      dest.writeString(device_name);
      dest.writeString(device_manufacturer);
      dest.writeString(device_model);
      dest.writeInt(backup_contacts_count);
      dest.writeString(description);
      dest.writeList(backup_contacts);
  
  }
  
  /** Static field used to regenerate object, individually or as arrays */
  public static final Parcelable.Creator&lt;PhoneBackup&gt; CREATOR = new Parcelable.Creator&lt;PhoneBackup&gt;() {
      public PhoneBackup createFromParcel(Parcel pc) {
          return new PhoneBackup(pc);
      }
      public PhoneBackup[] newArray(int size) {
          return new PhoneBackup[size];
      }
  };
  </code></pre>
  
  <p>The <code>NullPointerException</code> is with my <code>backup_contacts</code>. But <code>backup_contacts</code> has the correct size but the containts are all <code>null</code> and as I need to read the contents of <code>backup_contacts</code> using <code>get(position)</code> I receive a <code>null</code> value and not a <code>String</code>.</p>
  
  <p>Question is, why is the <code>Parcelable</code> passing null values to the <code>ArrayList&lt;String&gt;</code> and not he actual Strings? How can I fix it?</p>