How to implement the write & read in Parcelable Class
<h1>Parcelable</h1>

<p>I have this <code>Player</code> Class:</p>

<pre><code>public class Player implements Parcelable {
private String mName; // Player's name
private Card mCard; // Player's current card
private boolean mLifeStatus = true; // Player's life status
private boolean mProtected = false; // If the Player's been protected by the guard or not
private int mId; // ID of the Player
private int mCount;

/* everything below here is for implementing Parcelable */

// 99.9% of the time you can just ignore this
@Override
public int describeContents() {
    return 0;
}

// write your object's data to the passed-in Parcel
@Override
public void writeToParcel(Parcel out, int flags) {
    out.writeString(mName);
    out.writeValue(mCard);
    out.writeValue(mLifeStatus);
    out.writeValue(mProtected);
    out.writeInt(mId);
    out.writeInt(mCount);
}

// this is used to regenerate your object. All Parcelables must have a CREATOR that implements these two methods
public static final Parcelable.Creator&lt;Player&gt; CREATOR = new Parcelable.Creator&lt;Player&gt;() {
    public Player createFromParcel(Parcel in) {
        return new Player(in);
    }

    public Player[] newArray(int size) {
        return new Player[size];
    }
};

// example constructor that takes a Parcel and gives you an object populated with it's values
private Player(Parcel in) {
    mName = in.readString();
    mCard = in.readValue();
    mLifeStatus = in.readValue(mLifeStatus);
    mProtected = in.readValue(mProtected);
    mId = in.readInt();
    mCount = in.readInt();
}
}
</code></pre>

<p>I've tried to fill the last constructor by myself, but I don't know how to read the value of booleans and of custom classes, just like my <code>Card</code> class, which is the Class for the mValue <code>mCard</code>.</p>

<p>I tried to use this but still didn't work: <code>mCard = in.readValue(Card.class.getClassLoader);</code></p>

<p>How should I write these two methods in order to make the Class implement <code>Parcelable</code> how it's supposed to be?</p>