i want top score ,i used static variable to store it but when i closed application and reopen entire application values top score starts from 0 .but i want my past top score .please help me....
public static void updateScore(int score) {
if(UserInfo.isStorageAvailable()) {
System.err.printLn(„No storage available“);
return;
}
UserInfo user = UserInfo.getMyInfo();
if(user.getScore() >= score)
return; // No new highscore, so don’t update it
user.setScore(score);
user.store();
}
public void getHigh() {
UserInfo user = UserInfo.getMyInfo();
return user != null ? user.getScore() : 0;
}