Change Whole Application Language based on Spinner Selected Value
<p>In my application, I have numbers of Activity Classes and I want to change entire Application Language Based on Spinner Value Selected. Please help me. I am able to change single activity language by following code. </p>

<pre><code>    public void onItemSelected(AdapterView&lt;?&gt; parent, View view,
                int pos, long id) {

            if (pos == 1) {

                Toast.makeText(parent.getContext(),
                        "You have selected Tamil", Toast.LENGTH_SHORT)
                        .show();
                setLocale("ta");
            } else if (pos == 2) {

                Toast.makeText(parent.getContext(),
                        "You have selected Hindi", Toast.LENGTH_SHORT)
                        .show();
                setLocale("hi");
            } else if (pos == 3) {

                Toast.makeText(parent.getContext(),
                        "You have selected English", Toast.LENGTH_SHORT)
                        .show();
                setLocale("en");
            }

        }

        public void onNothingSelected(AdapterView&lt;?&gt; arg0) {
            // TODO Auto-generated method stub
        }

    });
}

public void setLocale(String lang) {

    myLocale = new Locale(lang);
    Resources res = getResources();
    DisplayMetrics dm = res.getDisplayMetrics();
    Configuration conf = res.getConfiguration();
    conf.locale = myLocale;
    res.updateConfiguration(conf, dm);
    Intent refresh = new Intent(this, ActivityLanguage.class);
    startActivity(refresh);
}
</code></pre>

<p>}</p>