Fix a crash when changing language

This commit is contained in:
Thomas 2022-12-16 09:48:39 +01:00
parent 295243d781
commit 1cf3519951

View file

@ -55,7 +55,8 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { 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) { 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()); Helper.recreateMainActivity(requireActivity());
} }
} }