title: retrofit header not change immediately
body: <p>In my app I have a <code>spinner</code> that includes some language abbreviation example (en, az, and others), I want to set selected language abbreviation as the request header and I need this in every request so I am saving abbreviation in shared preferences and get abbreviation in my <code>ApiClient</code> class,
  every time that spinner selection has changed I change shared preferences abbreviation value but header only set the first time I select a language and when I change spinner selection header not change</p>
  
  <p><strong>This is my ApiClient class</strong></p>
  
  <pre><code>private static final String BASE_URL = ApiUrls.server_url;
  
  public static Retrofit getClient(Context context)
  {
  
      SharedPrefUtil sharedPrefUtil = new SharedPrefUtil(context);
      String locale = sharedPrefUtil.getSelectedLanguage();
  
      OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
  
      httpClient = httpClient.addInterceptor(new Interceptor() {
          @Override
          public Response intercept(Chain chain) throws IOException
          {
              Request request = chain.request().newBuilder().header("Accept-Language",
                      locale).build();
  
              return chain.proceed(request);
          }
      });
  
      Retrofit retrofit = new Retrofit.Builder().baseUrl(BASE_URL)
              .addConverterFactory(GsonConverterFactory.create()).client(httpClient.build())
              .build();
  
      return retrofit;
  }
  </code></pre>
  
  <p><strong>This is my ApiRequester class method for sending a request to server</strong></p>
  
  <pre><code>public static void sendLogin(final Context context, Map&lt;String, String&gt; params,
                               final HttpResponses.onLoginSuccess onLoginSuccess) {
  
      DialogHelper.ProgressDialog progressDialog = showWaitDialog(context);
  
      if (hasInternetConnection(context)) {
          params.put("grant_type", "password");
          params.put("client_id", "raymon-client");
          params.put("client_secret", "raymon-secret");
  
          ApiInterface apiService = ApiClient.getClient(context).create(ApiInterface.class);
          Call&lt;ResponseBody&gt; call = apiService.loginRequest(params);
  
          call.enqueue(new Callback&lt;ResponseBody&gt;() {
              @Override
              public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
                  progressDialog.dismiss();
  
                  //result ok
                  if (response.code() == 200)
                  {
                      try
                      {
                          onLoginSuccess.loginResponse(JsonSuccessParser.parseLoginResponse
                                  (context, response.body().string()));
  
                      } catch (IOException e)
                      {
                          e.printStackTrace();
                      }
                  }
                  else if (response.code() == 403)
                  {
                      onLoginSuccess.loginError(response.code());
                  }
                  else
                  {
                      try
                      {
                          JsonErrorParser.parseServerError(context,response.errorBody().string());
  
                      } catch (IOException e)
                      {
                          e.printStackTrace();
                      }
                  }
              }
  
              @Override
              public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
                  progressDialog.dismiss();
                  showNoConnectionDialog(context);
              }
          });
      } else {
          progressDialog.dismiss();
          showNoConnectionDialog(context);
  
      }
  
  
  }
  </code></pre>
  
  <p><strong>This is my code for setting language abbreviation in shared preferences</strong></p>
  
  <pre><code>private void setUserLocale()
  {
      String selected_country = countryCodeAdapter.getItem(country_code_spinner.
              getSelectedItemPosition()).language.abbreviation.toLowerCase();
  
      LocaleHelper.setLocale(this,selected_country);
  }
  </code></pre>
  
  <p>How can I change header immediately when user change spinner position?</p>