I'm having trouble to store Lists in the storage and then loading it after a new start of my app. Here is what I've done:
At every start of the app I do this, to check if Data has already been written to the storage, if not, I return a new List.
public List loadSavedFormationList(){
String[] temp = Storage.getInstance().listEntries();
for(String s: temp){
if(s.equals("Formations") == true){
return (LinkedList<SongList>)Storage.getInstance().readObject("Formations");
}
}
return new LinkedList<SongList>();
}
When the user has entered a FormationList in my App, I do this to save it to the storage:
Storage.getInstance().writeObject("Formations", formationList);
Now, when I restart the App, I am getting a java.io.EOFException + java.lang.NullpointerException. It seems that he tries to read my Formations List from the storage, but it is empty, but why? On the first start of the App, the Storage should be empty. Does the Simulator also save the stuff I entered into the App at another time?
Thank you for any advice.