Error JVM 525: bad object persistent ~ ~ ~ help!

I do a game and I want to keep him persistent statistics.  I use the PersistantObject class as in my code below, but I get the following error on the Simulator:

Error JVM 525

Bad object persistent: Stats

The Simulator does not load fully.

This code is where I declare my instance variables - it's straight out of the JDE 4.7.0 QAnywhere

private static Stats Statistics
private static PersistentObject persist;
{public static
long KEY = 0xa3b3159378f59a29L;
persist is PersistentStore.getPersistentObject (KEY);.
Statistics = persist.getContents () (statistics);
If (statistics == null) {}
Statistics = New Stats();
persist.setContents (statistics);
Persist.Commit ();
}
}

This method is to update my persistent object

protected void updateStats (int score) {}
statistics.hiScore = (statistics.hiScore > = result)? statistics.hiScore: mark.
statistics.recentScore = result;
statistics.aveScore = (statistics.aveScore * statistics.gamesPlayed + score) / ++ statistics.gamesPlayed;
Persist.Commit ();
}

It's the Stats class

public class {Stats
public int recentScore = 0;
public int hiScore = 0;
public int aveScore = 0;
public int gamesPlayed = 0;
   
Stats() {}
His stats (rs, int, int, like int gp hs int) {}
recentScore = rs;
hiScore = hs;
aveScore = have;
gamesPlayed = gp;
}
}

Any help would be appreciated - thanks

Cameron

You must implement Persistable in your stat. class as

public class Stats  implements Persistable
{

}

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for