I have an ArrayList, and each object consists of an array of two floats representing coordinates. I found that I could serialize the ArrayList by calling the .toString() method on it, but this did not serialize the float arrays within the ArrayList. How can I go about serializing those as well?
Here is basically what I did:
private ArrayList<float[]> pointsList = new ArrayList<float[]>();
In an onTouch method, I add coordinates to the list:
float[] thisPosition = new float[2];
thisPosition[0] = touchX;
thisPosition[1] = touchY;
pointsList.add(thisPosition);
Then I serialize the ArrayList like this:
pointsList.toString();
But each item in the list is turned into F@426d51d8 and other strings like that. How can I serialize these sub-arrays and preserve their numeric values? I have searched forums here on StackOverflow and elsewhere, but other similar questions address how to make an ArrayList of String arrays or other ArrayLists.