title: Android N change language programmatically
body: <p>I found really weird bug that is reproduced only on Android N devices.</p>
  
  <p>In tour of my app there is a possibility to change language. Here is the code that changes it. </p>
  
  <pre><code> public void update(Locale locale) {
  
      Locale.setDefault(locale);
  
      Configuration configuration = res.getConfiguration();
  
      if (BuildUtils.isAtLeast24Api()) {
          LocaleList localeList = new LocaleList(locale);
  
          LocaleList.setDefault(localeList);
          configuration.setLocales(localeList);
          configuration.setLocale(locale);
  
      } else if (BuildUtils.isAtLeast17Api()){
          configuration.setLocale(locale);
  
      } else {
          configuration.locale = locale;
      }
  
      res.updateConfiguration(configuration, res.getDisplayMetrics());
  }
  </code></pre>
  
  <p>This code works great in activity of my tour ( with <code>recreate()</code> call) but in all next activities all String resources are wrong. Screen rotation fixes it. What can i do with this problem? Should i change locale for Android N differently or it's just system bug?</p>
  
  <p>P.S. Here's what i found. At first start of MainActivity (which is after my tour) <code>Locale.getDefault()</code> is correct but resources are wrong. But in other activities it gives me wrong Locale and wrong resources from this locale. After rotation screen (or perhaps some other configuration change) <code>Locale.getDefault()</code> is correct.</p>