Recreate activity to update locale

This commit is contained in:
Chumva 2019-09-02 10:10:03 +03:00
parent 52b29156f4
commit 41a85e5b49

View file

@ -1,5 +1,6 @@
package net.osmand.plus.settings;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
@ -259,11 +260,12 @@ public class GlobalSettingsFragment extends BaseSettingsFragment {
settings.PREFERRED_LOCALE.addListener(new StateChangedListener<String>() {
@Override
public void stateChanged(String change) {
// restart application to update locale
// recreate activity to update locale
Activity activity = getActivity();
OsmandApplication app = getMyApplication();
if (app != null) {
if (app != null && activity != null) {
app.checkPreferredLocale();
app.restartApp(getContext());
activity.recreate();
}
}
});