public void removeListener(OnSettingChangedListener listener){
synchronized (mLock) {
    if (listener == null) {
      throw new IllegalArgumentException();
    }
    if (!mListeners.contains(listener)) {
      return;
    }
    int index=mListeners.indexOf(listener);
    mListeners.remove(listener);
    OnSharedPreferenceChangeListener sharedPreferenceListener=mSharedPreferenceListeners.get(index);
    mSharedPreferenceListeners.remove(index);
    mDefaultPreferences.unregisterOnSharedPreferenceChangeListener(sharedPreferenceListener);
    if (mCustomPreferences != null) {
      mCustomPreferences.unregisterOnSharedPreferenceChangeListener(sharedPreferenceListener);
    }
  }
}

public void removeListener ( OnSettingChangedListener listener ) { synchronized ( mLock ) { if ( listener == null ) { throw new IllegalArgumentException ( ) ; } if ( ! mListeners . contains ( listener ) ) { return ; } int index = mListeners . indexOf ( listener ) ; mListeners . remove ( listener ) ; OnSharedPreferenceChangeListener sharedPreferenceListener = mSharedPreferenceListeners . get ( index ) ; mSharedPreferenceListeners . remove ( index ) ; mDefaultPreferences . unregisterOnSharedPreferenceChangeListener ( sharedPreferenceListener ) ; if ( mCustomPreferences != null ) { mCustomPreferences . unregisterOnSharedPreferenceChangeListener ( sharedPreferenceListener ) ; } } }
remove a specific settingslistener . this should be done in onpause if a listener has been set .
