title: Bad magic number for Bundle in Android
body: <p>I'm passing data from one activity to other activity with this code:</p>
  
  <pre><code> @Override
      public void execute(List&lt;Report&gt; reports, Questions question) {
          Intent replyIntent = new Intent(listener, ReplyActivity.class);
          replyIntent.putExtra("id", 0L);
          replyIntent.putExtra("questions", question);
          listener.openReportOk(question);
          listener.startActivity(replyIntent);
      }
  </code></pre>
  
  <p>Listener its a Activity reference for callbacks.</p>
  
  <p>Questions is this class:</p>
  
  <pre><code>@Table(name = "Questions")
  public class Questions extends Entity implements Parcelable {
  
      public static final Creator&lt;Questions&gt; CREATOR = new Creator&lt;Questions&gt;() {
          public Questions createFromParcel(Parcel source) {
              return new Questions(source);
          }
  
          public Questions[] newArray(int size) {
              return new Questions[size];
          }
      };
  
      @TableField(name = "idReport", datatype = DATATYPE_INTEGER)
      private int idReport;
      @TableField(name = "nameReport", datatype = DATATYPE_STRING)
      private String nameReport;
      @TableField(name = "replyGroups", datatype = DATATYPE_STRING)
      private String replyGroups;
      @TableField(name = "questionGroups", datatype = DATATYPE_ENTITY)
      private List&lt;QuestionsGroup&gt; questionsGroup;
      private Boolean canCreateNew;
  
      public Questions(int idReport, String nameReport, String replyGroups, List&lt;QuestionsGroup&gt; questionsGroup) {
          this.idReport = idReport;
          this.nameReport = nameReport;
          this.replyGroups = replyGroups;
          this.questionsGroup = questionsGroup;
          this.canCreateNew = false;
      }
  
      public Questions() {
          questionsGroup = new ArrayList&lt;QuestionsGroup&gt;();
      }
  
      private Questions(Parcel in) {
          this();
          this.idReport = in.readInt();
          this.nameReport = in.readString();
          this.replyGroups = in.readString();
          Bundle b = in.readBundle(QuestionsGroup.class.getClassLoader());
          this.questionsGroup = b.getParcelableArrayList("questionGroups");
          this.canCreateNew = (Boolean) in.readValue(Boolean.class.getClassLoader());
      }
  
  
      @Override
      public int describeContents() {
          return 0;
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeInt(this.idReport);
          dest.writeString(this.nameReport);
          dest.writeString(this.replyGroups);
          Bundle b = new Bundle();
          b.putParcelableArrayList("questionGroups", (ArrayList&lt;QuestionsGroup&gt;) this.questionsGroup);
          dest.writeBundle(b);
          dest.writeValue(this.canCreateNew);
      }
  }
  </code></pre>
  
  <p>And when i receive the parcels in onCreate method:</p>
  
  <pre><code> private void getData(Intent data) {
          ID = data.getExtras().getLong("id");
          questions = data.getExtras().getParcelable("questions");
      }
  </code></pre>
  
  <p>Im getting this error:</p>
  
  <pre><code>10-05 13:19:15.508    3499-3499/com.firext.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.firext.android, PID: 3499
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.firext.android/com.firext.android.activities.reply.ReplyActivity}: java.lang.IllegalStateException: Bad magic number for Bundle: 0x28
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
              at android.app.ActivityThread.access$800(ActivityThread.java:143)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5070)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
       Caused by: java.lang.IllegalStateException: Bad magic number for Bundle: 0x28
              at android.os.BaseBundle.readFromParcelInner(BaseBundle.java:1342)
              at android.os.BaseBundle.&lt;init&gt;(BaseBundle.java:90)
              at android.os.Bundle.&lt;init&gt;(Bundle.java:66)
              at android.os.Parcel.readBundle(Parcel.java:1645)
              at com.firext.android.domain.QuestionsGroup.&lt;init&gt;(QuestionsGroup.java:53)
              at com.firext.android.domain.QuestionsGroup$1.createFromParcel(QuestionsGroup.java:25)
              at com.firext.android.domain.QuestionsGroup$1.createFromParcel(QuestionsGroup.java:23)
              at android.os.Parcel.readParcelable(Parcel.java:2160)
              at android.os.Parcel.readValue(Parcel.java:2066)
              at android.os.Parcel.readListInternal(Parcel.java:2422)
              at android.os.Parcel.readArrayList(Parcel.java:1756)
              at android.os.Parcel.readValue(Parcel.java:2087)
              at android.os.Parcel.readArrayMapInternal(Parcel.java:2393)
              at android.os.BaseBundle.unparcel(BaseBundle.java:221)
              at android.os.Bundle.getParcelableArrayList(Bundle.java:782)
              at com.firext.android.domain.Questions.&lt;init&gt;(Questions.java:58)
              at com.firext.android.domain.Questions.&lt;init&gt;(Questions.java:18)
              at com.firext.android.domain.Questions$1.createFromParcel(Questions.java:22)
              at com.firext.android.domain.Questions$1.createFromParcel(Questions.java:20)
              at android.os.Parcel.readParcelable(Parcel.java:2160)
              at android.os.Parcel.readValue(Parcel.java:2066)
              at android.os.Parcel.readArrayMapInternal(Parcel.java:2393)
              at android.os.BaseBundle.unparcel(BaseBundle.java:221)
              at android.os.Bundle.getParcelable(Bundle.java:738)
              at com.firext.android.activities.reply.ReplyActivity.getData(ReplyActivity.java:72)
              at com.firext.android.activities.reply.ReplyActivity.onCreate(ReplyActivity.java:38)
              at android.app.Activity.performCreate(Activity.java:5720)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1102)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2208)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
              at android.app.ActivityThread.access$800(ActivityThread.java:143)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5070)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
  </code></pre>
  
  <p>Whats wrong?</p>