Code example for Parcel

Methods: writeIntwriteValue

0
		 * @param parcel the Parcel in which the object should be written. 
		 * @param flags additional flags about how the object should be written. 
		 */ 
		@Override 
		public void writeToParcel(Parcel parcel, int flags) {
			parcel.writeInt(booleanArg ? 1 : 0);
			parcel.writeValue(stringArg); // enum
		} 
 
		/** 
		 * Construct via parcel. 
		 */ 
		protected Toggle(Parcel parcel) {
			booleanArg = parcel.readInt() == 1;
			stringArg = parcel.readString(); // enum
		} 
 
		/** 
		 * Generates instances of this Parcelable class from a Parcel. 
		 */ 
		public static final Parcelable.Creator<Toggle> CREATOR = new Parcelable.Creator<Toggle>() {