In my Preference activity, say I have two checkboxpreference. If I select the first one, the second one is enabled, but if I deselect the first one, the second one is disabled.
My question is, if the first one is deselected and someone clicks the disabled second preference (it’s greyed out), is it possible to attach a hint to it when disabled to tell the user that they must first select the above preference in order to enable the second one?
I looked in the Preferences API, but could not find anything to match this requirement.
Any tips?
Thanks!
Use the preference’s summary as your hint. This will provide some text below the checkbox and its title in smaller print.
By xml:
http://developer.android.com/reference/android/preference/Preference.html#attr_android:summary
By code:
http://developer.android.com/reference/android/preference/Preference.html#setSummary(int)