Team
유형의 객체를 내 앱의 다른 Activity
에 전달하려고합니다.parcelable을 사용하여 한 Android 활동에서 다른 활동으로 개체를 보내는 방법은 무엇입니까?
TreeMap<String, HashMap<Integer, ArrayList<Event>>> matchDays;
어떻게 클래스의 나머지와 함께 중첩 된 트리 맵을 전달할 수 있습니다
Team
클래스 : 정렬 화시
public class Team implements Parcelable {
String teamName;
//Name and Link to competition of Team
TreeMap<String, String> competitions;
//Name of competition with a map of matchdays with all games to a matchday
TreeMap<String, HashMap<Integer, ArrayList<Event>>> matchDays;
public int describeContents() {
return 0;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(teamName);
dest.writeMap(competitions);
}
public static final Parcelable.Creator<Team> CREATOR = new Parcelable.Creator<Team>() {
public Team createFromParcel(Parcel in) {
return new Team(in);
}
public Team[] newArray(int size) {
return new Team[size];
}
};
private Team(Parcel in) {
teamName = in.readString();
in.readMap(competitions, Team.class.getClassLoader());
}
}
은 내가 RuntimeException을 얻을?
입니까? Event 클래스는 직렬화 가능합니까? – kosa