I am currently working on an droid app and was wondering if there is a way that a preference can be enabled or disabled based on the value of another preference.
For example, if I have checkbox_pref1 if this is enabled then option2/3/4 are enabled, if checkbox_pref1 is disabled option2/3/4 automatically become disabled or is this there an XML attribute that would accomplish this or is it something that I would need to code to achieve this effect.
Thanks for any help you can provide.
You can do this with the
dependencyattribute. In yourPreferenceXML, you would add the following line to yourcheckbox_pref2,checkbox_pref3, andcheckbox_pref2Preferences:Useful Links:
Android Quick Preferences Tutorial
Android Preference Documentation (#dependency)