【发布时间】:2023-03-07 02:47:01
【问题描述】:
我有一个叫Service的类,用来使用这个构造函数创建Service对象
public Service(int id, String service_name, String service_code) {
this.id = id;
this.service_name = service_name;
this.service_code = service_code;
}
然后我使用以下签名创建一个列表调用服务列表
List<Service> serviceList = new ArrayList<Service>
我尝试通过 Intent 像这样的对象传递这个 ArrayList
Intent i = new Intent(Classname.this, anotherClass.class);
i.putExtras("serviceList",serviceList);
startActivity(i);
但它失败了。我通过 ArrayList 对象传递意图的方式是什么。
【问题讨论】:
标签: android android-intent arraylist