CCUserDefaults not working on Android

Hi.

I have this code and the second time I’m trying to update the highscore, the highscorescore is not saved on the device. The first time goes fine, but second time and news doesn’t work. It’s like updating the file does’nt work.

@
void GameManager::setCurrentHighScore(int *highscore){
if{
CCUserDefault::sharedUserDefault->setIntegerForKey;
highScore=*highscore;
}
}
@

Note: On iPhone everything goes fine.

I have a ZTE Blade with android 2.3.4

What’s the error?
Which version of cocos2d-x did you use?

I use the latest one. cocos2d-1.0.1-x-0.11.0 release

I found a method for saving the results, but I don’t like it.

I make this.

@
void GameManager::setCurrentHighScore(int *highscore){
if{
CCUserDefault::sharedUserDefault->purgeSharedUserDefault;
CCUserDefault::sharedUserDefault->setIntegerForKey;
highScore=*highscore;
}
}
@

First purge ant then save. Then it works. But I need to save a lot of data and I don’t want to purge everytime I need to save the data.