【发布时间】:2021-02-20 00:05:23
【问题描述】:
我正在尝试将 arraylist 从活动传递到片段,但我使用 parceable 得到一个空值。
在主要活动中:
Bundle bundle = new Bundle();
bundle.putParcelableArrayList("cbookings", customerbooking);
Todaybooking tb = new Todaybooking();
tb.setArguments(bundle);
数组列表数据声明
ArrayList<Cbooking> customerbooking = new ArrayList<>();
在片段中:
ArrayList<Cbooking> customerbooking = new ArrayList<>();
Bundle extras = getActivity().getIntent().getExtras();
customerbooking = extras.getParcelableArrayList("cbookings");
Log.wtf("test", customerbooking.toString());
【问题讨论】:
标签: android arrays android-bundle