Here are two simple methods to write a boolean value into a Parcelable object and read a boolean from a Parcelabe.
public static void writeBoolean(Parcel destination, boolean value) { if (destination != null) { destination.writeInt(value ? 0 : 1); } }
public static boolean readBoolean(Parcel in) { if (in != null) { return in.readInt() == 1 ? true : false; } return false; }