title: Change Locale not work after migrate to Androidx
body: <p>I have an old project that supports multi-languages. I want to upgrade support library and target platform, <strong>Before migrating to <code>Androidx</code> everything works fine but now change language not work!</strong></p>
  
  <p>I use this code to change default locale of App</p>
  
  <pre><code>private static Context updateResources(Context context, String language)
  {
      Locale locale = new Locale(language);
      Locale.setDefault(locale);
  
      Configuration configuration = context.getResources().getConfiguration();
      configuration.setLocale(locale);
  
      return context.createConfigurationContext(configuration);
  }
  </code></pre>
  
  <p>And call this method on each activity by override <code>attachBaseContext</code> like this:</p>
  
  <pre><code>@Override
  protected void attachBaseContext(Context newBase)
  {
      SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
      String language = preferences.getString(SELECTED_LANGUAGE, "fa");
      super.attachBaseContext(updateResources(newBase, language));
  }
  </code></pre>
  
  <p>I try other method to get string and I noticed that ‍‍‍‍<code>getActivity().getBaseContext().getString</code> work and <code>getActivity().getString</code> not work. Even the following code does not work and always show <code>app_name</code> vlaue in default resource string.xml. </p>
  
  <pre><code>&lt;TextView
      android:id="@+id/textView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/app_name"/&gt;
  </code></pre>
  
  <p>I share a sample code in <a href="https://github.com/Freydoonk/LanguageTest" rel="noreferrer">https://github.com/Freydoonk/LanguageTest</a></p>
  
  <p>Also <code>getActivity()..getResources().getIdentifier</code> not work and always return 0!</p>