I am trying to change my application language but when I clicked the language button, in the pages, texts (strings) are changing but in the nav drawer nothing change. If an exit the program pages strings changing also nav drawer is changing. My problem is While the app is playing language button change together.
This code is changing languages:
@Override
public void onClick(View v) {
try {
if (home.dil == 2){
Toast.makeText(getActivity(), "Türk?e dili se?ildi", Toast.LENGTH_SHORT ).show();
dil = 1;
dild = "tr";
Fragment frg = new home();
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.detach(frg);
ft.attach(frg);
ft.addToBackStack(home.class.getSimpleName());
ft.commit();
FragmentTransaction fti = getFragmentManager().beginTransaction();
fti.detach(home.this).attach(home.this).commit();
}
else {
Toast.makeText(getActivity(), "English language selected", Toast.LENGTH_SHORT ).show();
dil = 2;
dild = "";
Fragment frg = new home();
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.detach(frg);
ft.attach(frg);
ft.addToBackStack(home.class.getSimpleName());
ft.commit();
FragmentTransaction fti = getFragmentManager().beginTransaction();
fti.detach(home.this).attach(home.this).commit();
}
} catch (Exception e) {
}
}
});
these are how it is going to show
This is how looking the nav drawer
question from:
https://stackoverflow.com/questions/65865075/i-am-not-changing-strings-in-the-nav-drawer-when-i-clicked-change-language-butt%c4%b1 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…