public boolean onPreferenceChange(Preference preference, Object newValue) { if (preference != null && preference instanceof SecurityItemPreference) { Xlog.d(TAG, "onPreferenceChange, select " + preference.getKey() + " active"); Settings.Global.putString( getContentResolver(), Settings.Global.NFC_MULTISE_ACTIVE, preference.getKey()); mProgressCategory.setProgress(true); mSwitchBar.setEnabled(false); for (SecurityItemPreference pref : mItemPreferences) { pref.setEnabled(false); } return true; } return false; }
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { if (preference != null && preference instanceof SecurityItemPreference) { Xlog.d(TAG, "onPreferenceTreeClick " + preference.getKey()); String activeMode = Settings.Global.getString(getContentResolver(), Settings.Global.NFC_MULTISE_ACTIVE); String prefKey = preference.getKey(); if (prefKey != null && !(prefKey.equals(activeMode))) { Settings.Global.putString( getContentResolver(), Settings.Global.NFC_MULTISE_ACTIVE, preference.getKey()); mProgressCategory.setProgress(true); mSwitchBar.setEnabled(false); for (SecurityItemPreference pref : mItemPreferences) { pref.setEnabled(false); } return true; } } return false; }