CheckBoxPreferencepublic class CheckBoxPreference extends TwoStatePreference A {@link Preference} that provides checkbox widget
functionality.
This preference will store a boolean into the SharedPreferences. |
Constructors Summary |
---|
public CheckBoxPreference(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)
this(context, attrs, defStyleAttr, 0);
| public CheckBoxPreference(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr, int defStyleRes)
super(context, attrs, defStyleAttr, defStyleRes);
final TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.CheckBoxPreference, defStyleAttr, defStyleRes);
setSummaryOn(a.getString(com.android.internal.R.styleable.CheckBoxPreference_summaryOn));
setSummaryOff(a.getString(com.android.internal.R.styleable.CheckBoxPreference_summaryOff));
setDisableDependentsState(a.getBoolean(
com.android.internal.R.styleable.CheckBoxPreference_disableDependentsState, false));
a.recycle();
| public CheckBoxPreference(android.content.Context context, android.util.AttributeSet attrs)
this(context, attrs, com.android.internal.R.attr.checkBoxPreferenceStyle);
| public CheckBoxPreference(android.content.Context context)
this(context, null);
|
Methods Summary |
---|
protected void | onBindView(android.view.View view)
super.onBindView(view);
View checkboxView = view.findViewById(com.android.internal.R.id.checkbox);
if (checkboxView != null && checkboxView instanceof Checkable) {
((Checkable) checkboxView).setChecked(mChecked);
}
syncSummaryView(view);
|
|