我想通过intent将Object从一个activity传递给另一个 . 但我得到这个错误
新哈希0在索引1键为null的数组哈希3552645结束之前
活动1:
Intent intent = new Intent(Activity1.this, activity2.class);
intent.putExtra("mission", mission);
intent.putExtra("task", task);
startActivity(intent);
活动2:
Intent intent = getIntent();
mission = intent.getParcelableExtra("mission");
task = intent.getParcelableExtra("task");
这是我的日志:
新哈希0在数组哈希3552645结尾之前索引1键null java.lang.RuntimeException:此处位于android.u.ArrayMap.append(ArrayMap.java:521)android.os.Parcel.readArrayMapInternal(Parcel.java) :2618)在android.os.BaseBundle.unparcel(BaseBundle.java:221)的android.in.Bandle.getParcelable(Bundle.java:786)的android.content.Intent.getParcelableExtra(Intent.java:6223)at com位于android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1136)的android.app.Activity.performCreate(Activity.java:6877)上的.iperiatech.sams.mvp.Missions.TaskDetailActivity.onCreate(TaskDetailActivity.java:82) android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3208)在Android.app上的android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3351)android.app.ActivityThread.access $ 1100(ActivityThread.java:222) . ActivityThread $ H.handleMessage(ActivityThread.java:1796)at android.os.Handler.dispatchMessage(Handler.java:102)at android.os.Looper.loop(Looper.java: 158)在android.app.ActivityThread.main(ActivityThread.java:7230)at java.lang.reflect.Method.invoke(Native Method)at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java: 1230)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)