实现在SD卡中加载多个对象的代码:
ObjectInput in;
Dog dog = null;
try
{
in = new ObjectInputStream(new FileInputStream("/mnt/sdcard/somelocation/save.data"));
dog = (Dog) in.readObject();
in.close();
} catch (Exception e)
{
e.printStackTrace();
}
但是此代码只能加载一个对象。多谢指点。