title: How to get the device locale after changing the application locale
body: <p>I am changing the application locale based on user choice. Independent of device locale.</p>
  
  <p>using </p>
  
  <pre><code>public void setDefaultLocale(Context context, String locale) {
          Locale appLoc = new Locale(locale);
          Locale.setDefault(appLoc);
          Configuration appConfig = new Configuration();
          appConfig.locale = appLoc;
          context.getResources().updateConfiguration(appConfig,
                  context.getResources().getDisplayMetrics());
      }
  </code></pre>
  
  <p>But I want to know what will be the device locale also.</p>
  
  <p>When I am trying to get this I always getting the locale which I have set to application.</p>
  
  <p>ex: applictaion is in <strong><em>ENGLISH</em></strong> and device is in <strong><em>CHINESE</em></strong>.
  I am always getting <strong><em>english</em></strong>.</p>
  
  <p>for getting locale using,</p>
  
  <p><strong>option 1.</strong></p>
  
  <pre><code>String locale = context.getResources().getConfiguration().locale.getCountry();
  </code></pre>
  
  <p><strong>option 2.</strong></p>
  
  <pre><code>String local_country = ((Activity) context).getBaseContext().getResources().getConfiguration().locale.getCountry();
  </code></pre>
  
  <p>Any help will be highly appreciated!!!</p>