Refactoring

pull/156/head
M66B 6 years ago
parent defb8dd657
commit b4069d2d15

@ -122,11 +122,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("english", checked).commit(); // apply won't work here prefs.edit().putBoolean("english", checked).commit(); // apply won't work here
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);
} }
}); });
@ -250,4 +246,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
getString(R.string.title_advanced_last_cleanup, getString(R.string.title_advanced_last_cleanup,
time < 0 ? "-" : df.format(time))); 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);
}
} }

Loading…
Cancel
Save