title: SharedPreferences editor not executing
body: <p>In the following piece of code, one of the mEditor lines, doesn't appear to execute. <br>
  <br>I've tried many different combinations so far, but can't get it to execute properly. The value is not set at all. <br>
  If i try to use the value, like in a Toast, I will receive a ResourcesNotFound Exception</p>
  
  <p>Initialization of SharedPreference in my onCreateView, Fragment</p>
  
  <pre><code>mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());
  mEditor = mSharedPreferences.edit();
  </code></pre>
  
  <p><br></p>
  
  <pre><code> public void onClick(View view) {
  
          int round_number = mSharedPreferences.getInt(getString(R.string.pref_round_played),0);
  if (round_number == 0){
              game_team.setBackgroundResource(R.drawable.t);
              game_team.setVisibility(View.VISIBLE);
              knap_bund.setVisibility(View.INVISIBLE);
              knap_top.setText("Next Strat");
              mEditor.putString(getString(R.string.pref_chosen_team), "T");
              mEditor.putInt(getString(R.string.pref_round_played),round_number + 1);
              mEditor.apply();
                 //Show CT side Pistol round here//
              }
  </code></pre>
  
  <p>Following code is used in my onClick, which has other sharedPreferences, working the exact same way, which executes fine.
  The first line executes just fine, but the second line containing 'putInt' isn't executing as intended.</p>
  
  <pre><code>mEditor.putString(getString(R.string.pref_chosen_team), "T");
  mEditor.putInt(getString(R.string.pref_round_played), 1);
  mEditor.apply();
  </code></pre>
  
  <p><br>
  Example of working code:</p>
  
  <pre><code>
      else if(round_number &lt;= 30){
              mEditor.putInt(getString(R.string.pref_round_played),round_number + 1);
              mEditor.apply();
      }
  </code></pre>
  
  <p><strong>UPDATE</strong><br>
  Just to clarify due to the comments. It's only this one occasion where the sharedPreferences won't work. I use it about 15 other places in this fragment, with no issues at all</p>