onSharedPreferenceChanged called multiple times.... why?
<p>I have a preference Activity, at first when I chance a preference the onPreferenceChange is triggered once as expected. </p>

<p>However, after some time (going to different activities and such) the onPreferenceChange is called twice. </p>

<p>I see in the debugger that the WeakHashMap for the mListeners is 1 in the beginning and then becomes greater than 1, but not sure why?</p>

<pre><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getPrefs();
    int preferencesResource = 0; // R.xml.preferences;
    preferencesResource = getResources().getIdentifier("pref", "xml",
            getPackageName());
    addPreferencesFromResource(preferencesResource);
    listener = new SharedPreferences.OnSharedPreferenceChangeListener() {

        @Override
        public void onSharedPreferenceChanged(SharedPreferences arg0,
                String arg1) {
            // Why is this called once then sometimes twice!!
            Log.i("PreferencesActivity", "OnPreferenceChanged()");
        }
    };
    prefs.registerOnSharedPreferenceChangeListener(listener);
}

protected void onDestroy() {
    super.onDestroy();
    listener = null;
    prefs.unregisterOnSharedPreferenceChangeListener(listener);
    prefs = null;
}

public Preferences getPrefs() {
    if (prefs == null) prefs = new Preferences(this);
    return prefs;
}
</code></pre>
