title: Changing locale programmatically not working in some devices
body: <p>I've the following piece of code:</p>
  
  <pre><code>/**
   * Sets a new Locale for the APP.
   * @param newLocale - Valid new locale.
   */
  private static void setLocale( String newLocale )
  {
      Locale locale = new Locale( newLocale );
      Locale.setDefault( locale );
  
      Configuration config = new Configuration();
      config.locale = locale;
  
      context.getResources().updateConfiguration( config, context.getResources().getDisplayMetrics() );
  }
  </code></pre>
  
  <p>Simple.</p>
  
  <p>However when I run it in a Smartphone (4.1.1), it does work flawlessly. The device changes Strings in order to match the language.</p>
  
  <p>But with a tablet (4.3), it doesn't work. If I output something like:</p>
  
  <pre><code>Log.d("TAG",Locale.getDefault());
  </code></pre>
  
  <p>The Locale seems to be changed on both devices, but as I said, Strings doesn't get translated to the correct language.</p>
  
  <p>I've done a lot of debugging, and I've spotted a difference between objects:
  Check out the Configuration object on 4.1.1:</p>
  
  <p><img src="https://i.stack.imgur.com/QNpMa.png" alt="enter image description here"></p>
  
  <p>And check out the Configuration Object on the tablet (4.3)
  <img src="https://i.stack.imgur.com/J1FYb.png" alt="enter image description here"></p>
  
  <p>As you can see, the only notable difference is the <code>userSetLocale</code> which is set to False on tablet.</p>
  
  <p>So I checked Google SourceCode (<a href="https://github.com/android/platform_frameworks_base/blob/master/core/java/android/content/res/Configuration.java" rel="noreferrer">https://github.com/android/platform_frameworks_base/blob/master/core/java/android/content/res/Configuration.java</a>), and it states:</p>
  
  <pre><code> /**
   * Locale should persist on setting.  This is hidden because it is really
   * questionable whether this is the right way to expose the functionality.
   * @hide
   */
  public boolean userSetLocale;
  </code></pre>
  
  <p>Looks like this is affecting me. So as I can't access this value, nor by getter / setter nor by public access, I used reflection in order to change it.</p>
  
  <p>However, after changing it by reflection, even though I've seen that it internally changed (boolean is set to false after reflection), same issue is still up.</p>
  
  <p>Do you guys have any tips?</p>
  
  <p>Meanwhile I will keep testing.</p>
  
  <p>Thanks.
  <strong>TESTING:</strong></p>
  
  <ul>
  <li>Nexus 10 - 4.4.2 - OK</li>
  <li>Nexus 5 - 4.4.2 - OK</li>
  <li>Tablet 320 dpi - 4.4.2 - OK</li>
  <li>SmartPhone 480 dpi - 4.3 - OK</li>
  <li>SmartPhone 160 dpi - 4.1.1 - OK</li>
  <li>Tablet 160 dpi - 4.3 - <strong>NOT OK</strong></li>
  <li>SmartPhone 320 dpi - 4.1.1 - OK</li>
  </ul>