Not Able to change locale without recreating Activity
An application has support of two languages, when i change the language then i must have to recreate the activity to show to desired result but i don't want to do it.
private void setNewLocale(AppCompatActivity mContext, @LocaleManager.LocaleDef String language) {
LocaleManager.setNewLocale(this, language);
Intent intent = mContext.getIntent();
startActivity(intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK));
}
Also i set the text again on All textfield but it didn't help!
When i am on the third activity of app and i change the language when i get back to second activity the text on second and first activity if i want to then i have to recreate those activity as well which i think is bad approach to do it. I only want to change language but didn't want to recreate the activity!
On Button Click, i set the Locale!
if(appPreference.getLanguage().equalsIgnoreCase("en")){
setNewLocale(MainActivity.this, LocaleManager.ARABIC);
}
else
setNewLocale(MainActivity.this, LocaleManager.ENGLISH);