Restart instead of recreate after accepting EULA

pull/214/head
M66B 10 months ago
parent 8f43a4f013
commit ebd873511d

@ -461,8 +461,13 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
@Override @Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if ("eula".equals(key)) if ("eula".equals(key)) {
if (prefs.getBoolean(key, false)) boolean eula = prefs.getBoolean(key, false);
recreate(); if (eula) {
// recreate is done without animation
finish();
startActivity(getIntent());
}
}
} }
} }

@ -164,6 +164,11 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
menus.add(new NavMenuItem(R.drawable.twotone_close_24, R.string.title_setup_close, new Runnable() { menus.add(new NavMenuItem(R.drawable.twotone_close_24, R.string.title_setup_close, new Runnable() {
@Override @Override
public void run() { public void run() {
if (BuildConfig.DEBUG) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivitySetup.this);
prefs.edit().remove("eula").apply();
}
onMenuClose(); onMenuClose();
} }
}).setColor(colorWarning).setSeparated()); }).setColor(colorWarning).setSeparated());

Loading…
Cancel
Save