title: Nested parcelable object not reading
body: <p>I'm trying to parcel an object which contains some string/int variables and an object variable. The strings and int's are working, but not the nested object. I understand I would have to it also parcelable, but I'm apparently doing something wrong=. In my nested class, the <code>writeToParcel</code> method gets called (I check with a <code>Log.d()</code> call), but the <code>createFromParcel()</code> doesn't. I end up getting a <code>null</code> object. This is my simplified code:</p>
  
  <pre><code>public class MyClass implements Parcelable {
  
      public MyClass() {
      }
  
      private Integer id;
      private String name;    
      private MyOtherClass otherClass = new MyOtherClass();
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public OtherClass getOtherClass() {
          return otherClass;
      }
  
      public void setOtherClass(OtherClass otherClass) {
          this.otherClass = otherClass;
      }
  
      public static final Parcelable.Creator&lt;MyClass&gt; CREATOR
              = new Parcelable.Creator&lt;MyClass&gt;() {
          public MyClass createFromParcel(Parcel in) {
              return new MyClass(in);
          }
  
          public MyClass[] newArray(int size) {
              return new MyClass[size];
          }
      };
  
      @Override
      public int describeContents() {
          // TODO Auto-generated method stub
          return 0;
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeString(name);
          dest.writeInt(id);
          dest.writeParcelable(otherClass, flags);
      }
  
      private MyClass(Parcel in) {
          name = in.readString();
          id = in.readInt();
          otherClass = (OtherClass) in.readParcelable(OtherClass.class.getClassLoader());
      }
  }
  
  class MyOtherClass implements Parcelable {
  
      public OtherClass() {
      }
  
      private String resourcePreviewURL;
  
      public String getResourcePreviewURL() {
          return resourcePreviewURL;
      }
  
      public void setResourcePreviewURL(String resourcePreviewURL) {
          this.resourcePreviewURL = resourcePreviewURL;
      }
  
      public int describeContents() {
          return 0;
      }
  
      public void writeToParcel(Parcel out, int flags) {
          Log.d("parcel", "write to parcel"); // this gets called
          out.writeString(resourcePreviewURL);
      }
  
      public static final Parcelable.Creator&lt;MyOtherClass&gt; CREATOR
              = new Parcelable.Creator&lt;MyOtherClass&gt;() {
          public MyOtherClass createFromParcel(Parcel in) {
              Log.d("parcel", "create from parcel"); // this doesn't get called
              return new MyOtherClass(in);
          }
  
          public ResourcePreviews[] newArray(int size) {
              return new ResourcePreviews[size];
          }
      };
  
      private OtherClass(Parcel in) {
              Log.d("parcel", "read from parcel"); // this doesn't get called
          resourcePreviewURL = in.readString();
      }
  
  }
  </code></pre>