CheckBoxPreference

Typical xml code for checkbox preference entry.

    <CheckBoxPreference
        android:defaultValue="@bool/pref_show_text_default" // Default Boolean value: true (ticked) or false (unticked)
        android:key="@string/pref_show_text_key" // Key name to identify preference
        android:summaryOff="@string/pref_show_false" // Text to show if unticked
        android:summaryOn="@string/pref_show_true" // Text to show if ticked
        android:title="@string/pref_show_text_label" /> // Label for preference