intent传递实现序列化的对象太大,导致崩溃
giving up android.os.TransactionTooLargeException: data parcel size 952904 b
我之前的写法:
Intent intent = new Intent(XZXKActivity.this, XZXDRActivity.class);
Bundle bundle = new Bundle();
bundle.putSerializable("xzxk", xzxkBean);
intent.putExtras(bundle);
startActivity(intent);
我的解决方法是将xzxkbean对象用java静态类传递,跳转到activity之后再initview里取出来:
ListInfoDetails.setBean(xzxkBean);
Intent intent = new Intent(XZXKActivity.this, XZXDRActivity.class);
startActivity(intent);
ListInfoDetails:
public class ListInfoDetails {
public static XZXKBean mbean;
public static XZXKBean getBean() {
return mbean;
}
public static void setBean(XZXKBean bean) {
mbean = bean;
}
}