mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-04 03:43:55 +01:00
Refactoring
This commit is contained in:
@@ -122,11 +122,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("english", checked).commit(); // apply won't work here
|
||||
|
||||
Intent intent = new Intent(getContext(), ActivityMain.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
restart();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -250,4 +246,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
getString(R.string.title_advanced_last_cleanup,
|
||||
time < 0 ? "-" : df.format(time)));
|
||||
}
|
||||
|
||||
private void restart() {
|
||||
Intent intent = new Intent(getContext(), ActivityMain.class);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||
startActivity(intent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user