このコードを考えると:
public class TestSetup extends Object implements Serializable {
// ... some data and methods
}
ArrayList SetupArray = new ArrayList<TestSetup>();
// ----------------------------------------------
public boolean readExternalStorageObjectFile(String filename, Object obj) {
boolean isOk = true;
try {
File path = new File(sDirectoryPath + sTopDirectoryObj, filename);
FileInputStream out = new FileInputStream(path);
ObjectInputStream o = new ObjectInputStream(out);
obj = o.readObject();
o.close();
}
catch(Exception e) {
Log.e("Exception","Exception occured in reading");
isOk = false;
}
return isOk;
}
// ----------------------------------------------
public void loadSetups() {
this.SetupArray.clear();
this.readExternalStorageObjectFile(SETUPS_FILENAME, this.SetupArray);
}
loadSetups() の this.SetupArray には、readExternalStorageObjectFile() から読み込まれた既存の配列情報が含まれていると思いますが、そうではありません。
readExternalStorageObjectFile() にブレークポイントを設定すると、readObject() の実行時に obj に ArrayList 情報が含まれていることがわかります。
しかし、loadSetups() に戻ると、this.SetupArray はそうではありません。それは空です。
obj を ArrayList としてキャストしようとしましたが、同じ結果です。