So i made a game with a simple score keeping system, It seems that the highscore gets put into the shared prefs correctly, but when trying to load the high score into the activity oncreate the application crashes. this is my code.

```
SharedPreferences sharedPref = getPreferences(Context.MODE_PRIVATE);
    int score = sharedPref.getInt("SCORE", 0);
    String score2 = Integer.toString(score);
    text10.setText(score2);

```

Not sure what i'm doing wrong so any advice will be great!

Here is my save score code

```
private void savePref(String key, int value) {
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor edit = sp.edit();
    edit.putInt(key, value);
    edit.apply();
}

```