Most visited

Recently visited

CheckBoxPreference

public class CheckBoxPreference
extends TwoStatePreference

java.lang.Object
   ↳ android.support.v7.preference.Preference
     ↳ android.support.v7.preference.TwoStatePreference
       ↳ android.support.v7.preference.CheckBoxPreference


提供复选框小部件功能的 Preference

这个首选项会将一个布尔值存储到SharedPreferences中。

Summary

Inherited constants

From class android.support.v7.preference.Preference

Inherited fields

From class android.support.v7.preference.TwoStatePreference

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)

将创建的视图绑定到此首选项的数据。

Inherited methods

From class android.support.v7.preference.TwoStatePreference
From class android.support.v7.preference.Preference
From class java.lang.Object
From interface java.lang.Comparable

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)

将创建的视图绑定到此首选项的数据。

这是抓取对布局和自定义属性的自定义视图的引用的好地方。

确保调用超类的实现。

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.

Hooray!