This commit is contained in:
Chumva 2019-09-26 18:16:45 +03:00
parent aa2203f098
commit 0b6321d396
2 changed files with 7 additions and 3 deletions

View file

@ -991,14 +991,18 @@ public class OsmandApplication extends MultiDexApplication {
}
}
public void restartApp(Context ctx) {
public void restartApp(final Context ctx) {
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
bld.setMessage(R.string.restart_is_required);
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
android.os.Process.killProcess(android.os.Process.myPid());
if (ctx instanceof MapActivity) {
MapActivity.doRestart(ctx);
} else {
android.os.Process.killProcess(android.os.Process.myPid());
}
}
});
bld.show();

View file

@ -106,7 +106,7 @@ public class GlobalSettingsFragment extends BaseSettingsFragment implements Send
OsmandApplication app = getMyApplication();
if (app != null && activity != null) {
app.checkPreferredLocale();
activity.recreate();
app.restartApp(activity);
}
}
}