Code example for Parcel

Methods: readBooleanArray, readByte, readString

0
        mUsername = null;
        mPassword = null;
        mMobileNo = null;
 
        boolean[] validDataList = new boolean[MemberData.values().length];
        in.readBooleanArray(validDataList);
 
        if (validDataList[MemberData.USERNAME.ordinal()]) {
            mUsername = in.readString();
        } 
 
        if (validDataList[MemberData.PASSWORD.ordinal()]) {
            mPassword = in.readString();
        } 
 
        if (validDataList[MemberData.MOBILE_NO.ordinal()]) {
            mMobileNo = in.readString();
        } 
 
        if (validDataList[MemberData.SUBSCRIBER_ID.ordinal()]) {
            mSubscriberId = in.readString();
        } 
 
        mRememberMe = (in.readByte() == 0 ? false : true);
        mAutoConnect = (in.readByte() == 0 ? false : true);
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    public int describeContents() {