hi, ok i have written my own class, which should save a vector.
i run my application -> load non existing data -> nothing happens -> OK
i gererate some data to save it > save the data -> OK -> quit the application
i run my application again -> load existing data -> data is shown -> OK
i turn of my blackberry (remove the batterie) -> boot it -> run my application -> load da... what? where is my data? the vector is
null. what's wrong?
here is my complete class:
PHP Code:
class clsSave {
private static Vector _data;
private static PersistentObject store; // = PersistentStore.getPersistentObject(0x444ed4bfea1c3f22L);
clsSave() { // constructor
if (store == null) store = PersistentStore.getPersistentObject(0x444ed4bfea1c3f22L);
_data = new Vector();
}
public void save(Vector _liste) { // gets a vaector, and should save it
if (store == null) store = PersistentStore.getPersistentObject(0x444ed4bfea1c3f22L);
synchronized(store) {
store.setContents(_liste);
store.commit();
}
}
public Vector load() { // get the persistent data and returns a vector
synchronized(store) {
_data = (Vector)store.getContents();
}
return _data;
}
}
so why is teh data los when i turn off my BB?
thanks hibbert