When I click on the \"sub_changelang\" button, it should change the program language to French for example. I got the following code to change the locale but I have no idea
You can use activity.this.recreate().But it will support from API level 11.
I am using this code to set locale
String languageToLoad = "fr_FR";
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.locale = locale;
context.getResources().updateConfiguration(config,context.getResources().getDisplayMetrics());
Intent intent = new Intent(XYZ.this, XYZ.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
here context is application Base Context. Please also try "fr" instead of "fr_FR" because I am working for Arabic locale and its working fine.
You need to restart your Activity after changing locale.