0

guys... I am stuck with problem after app developed. Now We have a new requirement to change whole application language if user selects the German language. So how to handle this?

1 Answers1

0

Use this:

Resources res = context.getResources();
// Change locale settings in the app.
DisplayMetrics dm = res.getDisplayMetrics();
android.content.res.Configuration conf = res.getConfiguration();
conf.setLocale(new Locale(language_code.toLowerCase()); // API 17+ only.
// Use conf.locale = new Locale(...) if targeting lower versions
res.updateConfiguration(conf, dm);

For more info check this link : Change language programmatically in Android

sumit
  • 1,047
  • 1
  • 10
  • 15