public abstract Set<String> getStringSet (String key, Set<String> defValues)
public abstract void registerOnSharedPreferenceChangeListener (SharedPreferences.OnSharedPreferenceChangeListenerlistener)
Registers a callback to be invoked when a change happens to a preference.
Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
preference的管理器並不存儲一個listener的強引用,你必須指定強引用,否則會被GC回收,建議在listener的生命週期內保持一個對於它實例的引用
Parameters
listener | The callback that will run. |
---|