Example usage for Java android.preference SwitchPreference fields, constructors, methods, implement or subclass
The text is from its open source code.
SwitchPreference(Context context) Construct a new SwitchPreference with default style options. |
boolean | isChecked() Returns the checked state. |
void | setChecked(boolean checked) Sets the checked state and saves it to the SharedPreferences . |
void | setDependency(String dependencyKey) Sets the key of a Preference that this Preference will depend on. |
void | setEnabled(boolean enabled) Sets whether this Preference is enabled. |
void | setKey(String key) Sets the key for this Preference, which is used as a key to the SharedPreferences or PreferenceDataStore . |
void | setOnPreferenceChangeListener(OnPreferenceChangeListener onPreferenceChangeListener) Sets the callback to be invoked when this Preference is changed by the user (but before the internal state has been updated). |
void | setOnPreferenceClickListener(OnPreferenceClickListener onPreferenceClickListener) Sets the callback to be invoked when this Preference is clicked. |
void | setOrder(int order) Sets the order of this Preference with respect to other Preference objects on the same level. |
void | setPersistent(boolean persistent) Sets whether this Preference is persistent. |
void | setSummary(CharSequence summary) Sets the summary for this Preference with a CharSequence. |
void | setSummaryOff(CharSequence summary) Sets the summary to be shown when unchecked. |
void | setSummaryOn(CharSequence summary) Sets the summary to be shown when checked. |
void | setSwitchTextOff(CharSequence offText) Set the text displayed on the switch widget in the off state. |
void | setSwitchTextOff(@StringRes int resId) Set the text displayed on the switch widget in the off state. |
void | setSwitchTextOn(CharSequence onText) Set the text displayed on the switch widget in the on state. |
void | setSwitchTextOn(@StringRes int resId) Set the text displayed on the switch widget in the on state. |
void | setTitle(CharSequence title) Sets the title for this Preference with a CharSequence. |