// I declared myPrefs globally in the lass
SharedPreferences myPrefs = null;
// this is called in my do draw function
public void doDraw() {
}
myPrefs = this.getSharedPreferences("myPrefs", Context.MODE_WORLD_READABLE);
SharedPreferences.Editor editor = myPrefs.edit();
editor.putInt("MYHIGHSCORE", score);
editor.commit();
每当我打电话SharedPreferences.Editor editor = myPrefs.edit();
时,我的程序就会崩溃。我做错了什么?我正在尝试为高分系统存储一个 int 。并且SharedPreferences
对于像我这样的迷你高分系统提出了很多建议。