mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Restart instead of recreate after accepting EULA
This commit is contained in:
parent
8f43a4f013
commit
ebd873511d
2 changed files with 13 additions and 3 deletions
|
@ -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…
Reference in a new issue