Code example for CopyOnWriteArrayList

Methods: contains, remove

0
        mDictionaries.add(newDict);
    } 
 
    // Warning: this is not thread-safe. Take necessary precaution when calling. 
    public void removeDictionary(final Dictionary dict) {
        if (mDictionaries.contains(dict)) {
            mDictionaries.remove(dict);
        } else { 
            Log.w(TAG, "This collection does not contain this dictionary: " + dict);
        } 
    } 
}