title: Change device Language within my app
body: <p>I want to be able to change my phone settings within a button click inside my app. To be precise, I would like to change the phone's language. So far I created values/strings and values-iw/strings (hebrew strings) and within a button click I changed the configuration as follows:</p>
  
  <pre><code>    if (myLocale != null) {
          Locale.setDefault(myLocale);
          Configuration config = new Configuration();
          config.locale = myLocale;
          getBaseContext().getResources().updateConfiguration(config,
                  getBaseContext().getResources().getDisplayMetrics());
      }
  </code></pre>
  
  <p>This code changes the locale (I'm not sure about the difference between locale and language) but it does not affect all my activities. Thus, I tried to change the phone's language settings right from my app but did not manage to.
  Does anyone have an idea how do I make this code affect all my activities? Or instead - how to change my phone language (reflection??)...</p>
  
  <hr>
  
  <p>To make myself clear - I have Activity A which calls Activity B (I have many more activities all with<br>
  android:launchMode="singleInstance"
  in AndroidManifest).
  In activity B I changed locale language and returned to Activity A by the following lines:</p>
  
  <pre><code>    final Intent intent2 = new Intent(this, MainActivity.class);
      startActivity(intent2.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));
      finish();
  </code></pre>
  
  <p>The locale change does not affect Activity A (but affects all other activities, among them activity B). I assume the reason it does not affect Activity A is that activity A is still in the stack. I didn't manage to affect Activity A when changing locale. Does anyone have an idea how to affect also Activity A?</p>