Skip restart when night mode change (#2454)
This commit is contained in:
parent
a185496e41
commit
98ec80c28e
|
|
@ -235,10 +235,6 @@ public class SettingsFragment extends BaseFragment {
|
|||
theme.setOnPreferenceChangeListener((preference, newValue) -> {
|
||||
if (!App.getPreferences().getString("dark_theme", ThemeUtil.MODE_NIGHT_FOLLOW_SYSTEM).equals(newValue)) {
|
||||
AppCompatDelegate.setDefaultNightMode(ThemeUtil.getDarkTheme((String) newValue));
|
||||
MainActivity activity = (MainActivity) getActivity();
|
||||
if (activity != null) {
|
||||
activity.restart();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue