belongs to Maven artifact androidx.preference:preference:1.0.0-alpha1

CheckBoxPreference

public class CheckBoxPreference
extends TwoStatePreference

java.lang.Object
   ↳ androidx.preference.Preference
     ↳ androidx.preference.TwoStatePreference
       ↳ androidx.preference.CheckBoxPreference


A Preference that provides checkbox widget functionality.

This preference will store a boolean into the SharedPreferences.

Summary

Inherited XML attributes

Inherited constants

Inherited fields

Public constructors

CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr)
CheckBoxPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
CheckBoxPreference(Context context, AttributeSet attrs)
CheckBoxPreference(Context context)

Public methods

void onBindViewHolder(PreferenceViewHolder holder)

Binds the created View to the data for this Preference.

Inherited methods

Public constructors

CheckBoxPreference

CheckBoxPreference (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

CheckBoxPreference

CheckBoxPreference (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

Parameters
context Context

attrs AttributeSet

defStyleAttr int

defStyleRes int

CheckBoxPreference

CheckBoxPreference (Context context, 
                AttributeSet attrs)

Parameters
context Context

attrs AttributeSet

CheckBoxPreference

CheckBoxPreference (Context context)

Parameters
context Context

Public methods

onBindViewHolder

void onBindViewHolder (PreferenceViewHolder holder)

Binds the created View to the data for this Preference.

This is a good place to grab references to custom Views in the layout and set properties on them.

Make sure to call through to the superclass's implementation.

Parameters
holder PreferenceViewHolder: The ViewHolder that provides references to the views to fill in. These views will be recycled, so you should not hold a reference to them after this method returns.