intent传递序列化的集合对象

发送:

 public static void startAct(Context context, int type, List<OrderShowBean.GoodsBean> goods) {
        Intent intent = new Intent(context,EditHandleActivity.class);
        intent.putExtra("type", type);
        //传递从操作订单界面传递过来的数据
        Bundle bundle = new Bundle();
        bundle.putSerializable("list",(Serializable)goods);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }

接收:

    Intent intent = getIntent();
    mGoodsList = (List<OrderShowBean.GoodsBean>) intent.getSerializableExtra("list");

猜你喜欢

转载自blog.csdn.net/m0_37705108/article/details/84871550