Fix a crash when changing language

This commit is contained in:
Thomas 2022-12-16 09:48:39 +01:00
parent 295243d781
commit 1cf3519951
1 changed files with 2 additions and 1 deletions

View File

@ -55,7 +55,8 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.compareToIgnoreCase(getString(R.string.SET_DEFAULT_LOCALE_NEW)) == 0 || key.compareToIgnoreCase(getString(R.string.SET_TRANSLATE_VALUES_RESET)) == 0) {
requireActivity().recreate();
requireActivity().finish();
startActivity(requireActivity().getIntent());
Helper.recreateMainActivity(requireActivity());
}
}