static synchronized void load(KeyValueChangeListener listener) { // Load current settings for initialization of a listener implementor. for (Map.Entry<String, PreferenceValue> entry : sPrefMap.entrySet()) { listener.onKeyValueChanged(entry.getKey(), entry.getValue()); } registerListener(listener); }
private static void onKeyValueChanged(String key, PreferenceValue value) { for (WeakReference<KeyValueChangeListener> weakListener : sListeners) { KeyValueChangeListener listener = weakListener.get(); if (listener != null) listener.onKeyValueChanged(key, value); } }