Code example for Parcel

Methods: readArrayListreadIntreadLongreadString

0
	 
	/* 
	 * Function for reading the parcel 
	 */ 
	public DeviData(Parcel in) {
		id = in.readInt();
		title = in.readString();
		description = in.readString();
		body = in.readString();
 
		stops = new ArrayList<Integer>();
		in.readArrayList(Integer.class.getClassLoader());
		//in.readStringList(stops); 
		 
		lines = new ArrayList<Integer>();
		in.readArrayList(Integer.class.getClassLoader());
		 
		validFrom = in.readLong();
		validTo = in.readLong();
		important = in.readInt() == 1;
	} 
	 
	/* 
	 * Writing current data to parcel. 
	 * @see android.os.Parcelable#writeToParcel(android.os.Parcel, int)