1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-12-22 19:08:03 +01:00

Fixed SettingsActivity crash

This commit is contained in:
vanitasvitae 2016-10-14 12:32:55 +02:00
parent 0a4be1e502
commit 6d4bc38ea6
Signed by: vanitasvitae
GPG key ID: DCCFB3302C9E4615

View file

@ -142,11 +142,13 @@ public class SettingsActivity extends ThemedActivity implements IntellihideToolb
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
updatePreference(findPreference(key));
if (key.equals(getString(R.string.pref_key__intellihide_toolbars))) {
if (sharedPreferences.getBoolean(getString(R.string.pref_key__intellihide_toolbars), false)) {
((SettingsActivity) getActivity()).enableToolbarHiding();
} else {
((SettingsActivity) getActivity()).disableToolbarHiding();
if(isAdded()) {
if (key.equals(getString(R.string.pref_key__intellihide_toolbars))) {
if (sharedPreferences.getBoolean(getString(R.string.pref_key__intellihide_toolbars), false)) {
((SettingsActivity) getActivity()).enableToolbarHiding();
} else {
((SettingsActivity) getActivity()).disableToolbarHiding();
}
}
}
}