Most visited

Recently visited

Preference.OnPreferenceChangeListener

public static interface Preference.OnPreferenceChangeListener

android.support.v7.preference.Preference.OnPreferenceChangeListener


当此用户更改了此Preference的值并即将设置和/或保持时,将调用回调的接口定义。 这使客户有机会防止设置和/或保持价值。

Summary

Public methods

abstract boolean onPreferenceChange(Preference preference, Object newValue)

当用户更改首选项时调用。

Public methods

onPreferenceChange

boolean onPreferenceChange (Preference preference, 
                Object newValue)

当用户更改首选项时调用。 这在优先状态即将更新并且状态持续之前调用。

Parameters
preference Preference: The changed Preference.
newValue Object: The new value of the Preference.
Returns
boolean True to update the state of the Preference with the new value.

Hooray!