title: Multi language android app during Runtime?
body: <p>My aim is to change an application language from English to Chinese during runtime, is there any suggestions? </p>
  
  <pre><code> language_spinner = (Spinner)findViewById(R.id.settings_language_spinner);
   language_spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
  
              public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int pos, long id) {
                  if (pos == 1){
                      Toast.makeText(parent.getContext(),"You have selected English",Toast.LENGTH_SHORT).show();
                      setLocale("en");
  
                  }else if (pos == 2){
                      Toast.makeText(parent.getContext(),"You have selected Chinese",Toast.LENGTH_SHORT).show();
                      setLocale("zh");
                  }
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
  
              }
          });
  
  
      }
  
      public void setLocale(String lang) {
  
          myLocale = new Locale(lang);
          Resources res = getResources();
          DisplayMetrics dm = res.getDisplayMetrics();
          Configuration conf = res.getConfiguration();
          if (!conf.locale.getLanguage().equals(lang)) {
              conf.locale = myLocale;
              res.updateConfiguration(conf, dm);
              Intent refresh = new Intent(this, SettingsActivity.class);
              startActivity(refresh);
              finish();
          }
      }
  </code></pre>
  
  <p>This code is working properly with English but not working with Chinese 
  please help me in finding the solution ..</p>