Search code examples
androidandroid-preferences

CheckBoxPreference not checking when clicking on it


Is it possible to make CheckBoxPreference not selecting by clicking on it but only programically?


Solution

  • Use android:selectable="false" or android:enabled="false" in XML. Using android:enabled="false" also grays out the CheckBoxPreference. You can use setEnabled() or setSelectable() if you get CheckBoxPreference instance programmatically.