答案 0 :(得分:13)
好的,我只是使用之前引用的链接中的信息解决了这个问题。
这就是我所做的:
public enum Improvement {ENUM1, ENUM2, etc}
public void writeToParcel(Parcel dest, int flags) {
...
List<String> improvementStrings = new ArrayList<String>();
for (Improvement improvement : improvements) {
improvementStrings.add(improvement.name());
}
dest.writeList(improvementStrings);
}
public void readFromParcel(Parcel in) {
...
List<String> improvementStrings = new ArrayList<String>();
in.readList(improvementStrings, null);
for (String improvementString : improvementStrings) {
improvements.add(Improvement.valueOf(improvementString));
}
}