【发布时间】:2016-02-03 10:13:51
【问题描述】:
在Android 中,我想将设置值传递给另一个activity..我该怎么做?
Set<Person> persons=getPersons();
Intent intent = new Intent(getApplicationContext(), MainActivity2.class);
intent.putExtra("persons", persons); //Here I am getting error
startActivity(intent);
但我在intent.putExtra()..为什么出错?如何传递这些设置值?
【问题讨论】:
-
分享您的班级人员代码。
-
你需要使用paracable
-
persons 是一个集合类型,它会询问原始数据类型
-
使用
HashSet而不是Set
标签: android