so I am implementing a test app in which I will create a Tournament object as Parcelable and will pass them between intents. A tournament include: . A tournament name . Rule
here is code that show you how parcle a arraylist
public class ParcleListTopic implements Parcelable{
private List list;
private ArrayList listh=new ArrayList();
public ArrayList GetListTopic()
{
for(int i=0;i list)
{
this.list=list;
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator(){
public ParcleListTopic createFromParcel(Parcel s)
{
return new ParcleListTopic(s);
}
public ParcleListTopic[] newArray(int size)
{
return new ParcleListTopic[size];
}
};
public int describeContents() {
// TODO Auto-generated method stub
return 0;
}
}
public class ParcleTopic implements Parcelable
{
HoldListTopic hold;
public ParcleTopic(HoldListTopic hold)
{
this.hold=hold;
}
public HoldListTopic GetHold()
{
return hold;
}
public int describeContents()
{
return 0;
}
public void writeToParcel(Parcel dest, int flags)
{
dest.writeString(hold.Title);
dest.writeString(hold.Date);
dest.writeInt(hold.NumberComment);
dest.writeInt(hold.ID);
}
public ParcleTopic(Parcel in)
{
hold.Title=in.readString();
hold.Date=in.readString();
hold.NumberComment=in.readInt();
hold.ID=in.readInt();
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator()
{
public ParcleTopic createFromParcel(Parcel s)
{
return new ParcleTopic(s);
}
public ParcleTopic[] newArray(int size)
{
return new ParcleTopic[size];
}
}; }