Restart instead of recreate after accepting EULA

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

@ -461,8 +461,13 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if ("eula".equals(key))
if (prefs.getBoolean(key, false))
recreate();
if ("eula".equals(key)) {
boolean eula = prefs.getBoolean(key, false);
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() {
@Override
public void run() {
if (BuildConfig.DEBUG) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ActivitySetup.this);
prefs.edit().remove("eula").apply();
}
onMenuClose();
}
}).setColor(colorWarning).setSeparated());

Loading…
Cancel
Save