Code example for CopyOnWriteArrayList

Methods: clear

0
            OnSharedPreferenceChangeListener listener) {
        mListeners.add(listener);
    } 
     
    public void clearAllOnSharedPreferenceChangeListener() { 
        mListeners.clear();
    } 
 
    public void unregisterOnSharedPreferenceChangeListener( 
            OnSharedPreferenceChangeListener listener) {
        mListeners.remove(listener);
    } 
 
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
            String key) {
        for (OnSharedPreferenceChangeListener listener : mListeners) {
            listener.onSharedPreferenceChanged(this, key);
        } 
    } 
    public boolean isListenerRegisted() {