I have a following preference in my xml file:
<?xml version="1.0" encoding="utf-8"?>
<CheckBoxPreference android:title="Alert" android:widgetLayout="@layout/preference_checkbox" android:key="alert"
/>
I wanted to make my own custom checkbox, so as you can see above I gave this preference "android:widgetLayout" parameter, which links to this file:
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@drawable/checkbox"
android:id="@+id/alert">
Problem: With (widgetLayout) parameter, it doesn't save the checkbox value. So if I open preferences CheckBox is checked. Then if I uncheck it, and open preferences again, the value from before is not stored, or it does not persist. I don't have that problems if I use CheckBoxPreference without parameter "android:widgetLayou", which in this case, value is stored.
Any ideas?