@Override
  protected void onStop() {
    SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE);
    SharedPreferences.Editor editor = prefs.edit();

    editor.putInt("level", this.level);
    editor.putString("map", game.getLabyrinth().getJsonMap());
    editor.putString("howdy", game.getJsonHowdy());

    String allDoneLevelsString = "";

    for (String s : allDoneLevels) {
      allDoneLevelsString += s + ",";
    }

    if (allDoneLevelsString.length() > 0) {
      editor.putString(
          "doneLevels", allDoneLevelsString.substring(0, allDoneLevelsString.length() - 1));
    }

    editor.commit();

    super.onStop();
  }