I have used PreferenceActivity
to have preference in my android application. I want one preference say \"pref 2\" to be enabled when other preference say \"pref
I don't think there's any out-of-the-box solution for it, i.e. an inverted dependancy
attribute. But there's always the click-listener:
preference1.setOnPreferenceClickListener(pref1_click);
....
private OnPreferenceClickListener pref1_click = new OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
preference2.setEnabled(!preference1.isChecked());
return true;
}
}