We know that we can set a normal CheckBox by using the setChecked(boolean) method.
Is it possible to set the CheckBoxPreference through a method ?
Does there exist any method ?
We know that we can set a normal CheckBox by using the setChecked(boolean) method.
Share
How about…
setChecked(boolean)? When you get a reference to yourCheckBoxPreference(e.g. in yourPreferenceActivityorPreferenceFragment) you should have no problem using this method.I’m not sure what part you’re having trouble with, but the method call to
CheckBoxPreference‘ssetChecked(boolean)is no different from that of a regularCheckBox(as in: you just pass along a boolean value representing the ‘tick’):