I have a class below and would like to implement Parcelable. I got into a mistake. Please advice.
in.readValue(row);
Error message: readValue (ClassLoader) method in the Parcel type is not applicable for arguments (ArrayList)
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<String> column = new ArrayList<String>(); private ArrayList<cls_datarow> row = new ArrayList<cls_datarow>(); private int indexCounter = 0; private Hashtable<Integer, Integer> IDnIndex = new Hashtable<Integer, Integer>(); public cls_datatable(Parcel in) { readFromParcel(in); } public class cls_datarow { private ArrayList<String> columnValues; private int id; public cls_datarow(int id) { this.id = id; columnValues = new ArrayList<String>(); for (int i = 0; i < column.size(); i++) columnValues.add(null); } public cls_datarow() { columnValues = new ArrayList<String>(); for (int i = 0; i < 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); }
}
source share