I have been using this code:
public void saveCredits(int myInt) {
try {
OutputStream fos = openFileOutput("test.txt", Context.MODE_PRIVATE);
DataOutputStream dis = new DataOutputStream(fos);
dis.writeInt(myInt);
fos.flush();
fos.close();
}
catch (IOException e) {
System.out.println(e);
}
}
How do I modify it in the simplest way to also write an array of custom objects such as houses(String name, int cost, Address address)