when i press a button to change a new language from new string values but the layout doesn't changed, how can i do? this is my code:
btnChangeLng.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String language = "lo";
Locale locale = new Locale(language);
Locale.setDefault(locale);
Resources resources = getBaseContext().getResources();
DisplayMetrics displayMetrics = resources.getDisplayMetrics();
Configuration configuration = resources.getConfiguration();
configuration.locale = locale;
resources.updateConfiguration(configuration, displayMetrics);
Toast.makeText(Main_Activity.this, "Laos", Toast.LENGTH_LONG).show();
//refresh here
}
});
Language will change when i re-open this app, but it's not automatic change when i press a button, now i want to refresh my layout