Parcelable class
<p>I have a class below and would like to implement Parcelable.
I hit the error in. Please advice.</p>

<pre><code> in.readValue(row);
</code></pre>

<p>Error Message: The method readValue(ClassLoader) in the type Parcel is not applicable for the arguments (ArrayList)</p>

<pre><code>import java.util.ArrayList;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;

import android.os.Parcel;
import android.os.Parcelable;

public class cls_datatable implements Parcelable {
private ArrayList&lt;String&gt; column = new ArrayList&lt;String&gt;();
private ArrayList&lt;cls_datarow&gt; row = new ArrayList&lt;cls_datarow&gt;();
private int indexCounter = 0;
private Hashtable&lt;Integer, Integer&gt; IDnIndex = new Hashtable&lt;Integer, Integer&gt;();

public cls_datatable(Parcel in) {
    readFromParcel(in);
}

public class cls_datarow {

    private ArrayList&lt;String&gt; columnValues;
    private int id;

    public cls_datarow(int id) {
        this.id = id;
        columnValues = new ArrayList&lt;String&gt;();
        for (int i = 0; i &lt; column.size(); i++)
            columnValues.add(null);
    }

    public cls_datarow() {
        columnValues = new ArrayList&lt;String&gt;();
        for (int i = 0; i &lt; column.size(); i++)
            columnValues.add(null);
    }

    public int getID() {
        return id;
    }

    public String get(String columnName) {
        return columnValues.get(column.indexOf(columnName));
    }

    public String get(int columnIndex) {
        return columnValues.get(columnIndex);
    }

    public void set(String columnName, String value) {
        columnValues.set(column.indexOf(columnName), value);
    }

    public void set(int columnIndex, String value) {
        columnValues.set(columnIndex, value);
    }

    public int getColumnSize() {
        return column.size();
    }
}

public void addColumn(String columnName) {
    column.add(columnName);
}

// Depreciated function
public void addAllColumns(ArrayList&lt;String&gt; columns) {
    column.addAll(columns);
}

public void addAllColumns(String[] columns) {
    for (String col : columns) {
        column.add(col);
    }
}

public int getColumnSize() {
    return column.size();
}

public int getColumnIndex(String columnName) {
    return column.indexOf(columnName);
}

public int getRowSize() {
    return row.size();
}

public cls_datarow getRow(int rowIndex) {
    return row.get(rowIndex);
}

public void remove(int rowIndex) {
    row.remove(rowIndex);
    refreshIDnIndex();
}

public void remove(cls_datarow dataRow) {
    row.remove((int) IDnIndex.get(dataRow.getID()));
    refreshIDnIndex();
}

public void update(cls_datarow dataRow) {
    row.set(IDnIndex.get(dataRow.getID()), dataRow);
}

public void add(cls_datarow row) {
    IDnIndex.put(row.getID(), this.row.size());
    this.row.add(row);
}

public void addAllRows(ArrayList&lt;cls_datarow&gt; row) {
    for (cls_datarow r : row) {
        IDnIndex.put(r.getID(), this.row.size());
        this.row.add(r);
    }
}

public cls_datarow newRow() {
    cls_datarow dr = new cls_datarow(indexCounter);
    indexCounter++;
    return dr;
}

public cls_datatable copy() {
    cls_datatable dt = new cls_datatable(null);
    dt.addAllColumns(column);
    dt.addAllRows(row);
    return dt;
}

// inappropriate method
public ArrayList&lt;cls_datarow&gt; getAllRows() {
    return row;
}

public void clear() {
    row.clear();
}

public cls_datarow[] select(HashMap&lt;String, String&gt; condition) {
    ArrayList&lt;cls_datarow&gt; rs = new ArrayList&lt;cls_datarow&gt;();
    boolean isMatch = true;
    Iterator&lt;String&gt; i;

    for (cls_datarow r : row) {
        isMatch = true;
        i = condition.keySet().iterator();
        while (i.hasNext()) {
            String key = i.next();
            if (r.get(key) == null &amp;&amp; condition.get(key) != null)
                isMatch = false;
            if (r.get(key) != null &amp;&amp; condition.get(key) == null)
                isMatch = false;
            if (r.get(key) != null &amp;&amp; condition.get(key) != null
                    &amp;&amp; !r.get(key).equals(condition.get(key)))
                isMatch = false;
        }

        if (isMatch)
            rs.add(r);
    }

    return rs.toArray(new cls_datarow[rs.size()]);
}

private void refreshIDnIndex() {
    IDnIndex.clear();
    for (int i = 0; i &lt; row.size(); i++)
        IDnIndex.put(row.get(i).getID(), i);
}

@Override
public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
}


@Override
public void writeToParcel(Parcel dest, int flags) {

    // We just need to write each field into the
    // parcel. When we read from parcel, they
    // will come back in the same order
    dest.writeStringList(column);
    dest.writeValue(row);
    dest.writeInt(indexCounter);
    dest.writeValue(IDnIndex);
}

private void readFromParcel(Parcel in) {

    // We just need to read back each
    // field in the order that it was
    // written to the parcel
    in.readStringList(column);
     in.readValue(row);
    //indexCounter
    //IDnIndex
}


public static final Parcelable.Creator CREATOR =
    new Parcelable.Creator() {
        public cls_datatable createFromParcel(Parcel in) {
            return new cls_datatable(in);
        }

        public cls_datatable[] newArray(int size) {
            return new cls_datatable[size];
        }
    };
</code></pre>

<p>}</p>
