title: Automatically refresh All view in layout after language change
body: <p>In my app i have a spinner to select language "en" or "ar".I have <code>String.xml</code> for both languages. <br>Once we select language from spinner i want my layout to change in language chosen.</p>
  
  <p>I tried this but doesn't change when i select from spinner:</p>
  
  <pre><code> Spinner languageSpinner=(Spinner) findViewById(R.id.languagespinner);
              languageSpinner.setOnItemSelectedListener(new OnItemSelectedListener() {
  
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; arg0, View arg1,
                      int arg2, long arg3) {
  
                  if(arg2==0)
                      languageToLoad  = "en"; // your language
                  else
                      languageToLoad  = "ar";
                  Locale locale = new Locale(languageToLoad);  
                  Locale.setDefault(locale); 
                  Configuration config = new Configuration(); 
                  config.locale = locale; 
                  getBaseContext().getResources().updateConfiguration(config,  
                  getBaseContext().getResources().getDisplayMetrics());
                  onConfigurationChanged(config);
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
                  // TODO Auto-generated method stub
  
              }
          });
  </code></pre>
  
  <p>How can i do it?</p>