Fix #7587
This commit is contained in:
parent
aa2203f098
commit
0b6321d396
2 changed files with 7 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue