title: WebView language error Android N
body: <p>I am aware of <a href="https://stackoverflow.com/questions/40398528/android-webview-locale-changes-abruptly-on-android-n">this</a> question asked before about the WebView being broken in Android N especially with localization. I have another problem which I cannot figure out how to fix.</p>
  
  <p>As shown in <a href="https://i.stack.imgur.com/jMsFB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jMsFB.png" alt="this"></a> pic, I have two languages set on my Pixel device running 7.1.1. Now, I'm trying to load the following url in a WebView in my app.</p>
  
  <pre><code>"https://accounts.google.com/ServiceLogin?&lt;my-params&gt;"
  </code></pre>
  
  <p>What I notice is that the page loads in Chinese instead of English which is my current Locale language. I tried opening the above link on my Chrome desktop (where I am signed in with the same account as my phone) and it loads in Chinese too! I went to Chrome's settings to find that they language preferences are saved to my account because they show up in <a href="https://i.stack.imgur.com/JcdZt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JcdZt.png" alt="Chrome"></a> too.</p>
  
  <p>I did try setting locale before <code>setContentView()</code> in my app like this:</p>
  
  <pre><code>public static void setLocale(Locale locale){
      Locale.setDefault(locale);
      Configuration config = new Configuration();
      config.setLocale(locale);
      Context context = MyApplication.getInstance();
      context.getResources().updateConfiguration(config,
              context.getResources().getDisplayMetrics());
  }
  </code></pre>
  
  <p>but in vain. If I put a log statement, it prints the correct <code>Locale</code> which is <code>en-US</code>. The <code>WebView</code> still loads the page in Chinese though. Any thoughts on how can I fix it?</p>