Code example for Collection

Methods: remove

0
        mServiceListeners.add(l);
    } 
 
    // called from DockService 
    void removeServiceListener(ServiceListener l) {
        mServiceListeners.remove(l);
    } 
 
    // not synchronized: use only from UI thread! (TODO: verify) 
    void callServiceConnectedListeners() { 
        for (ServiceListener l : mServiceListeners) {
            l.onServiceConnected();
        } 
    } 
 
    // not synchronized: use only from UI thread! (TODO: verify) 
    void callServiceDisconnectedListeners() { 
        for (ServiceListener listener : mServiceListeners) {
            listener.onServiceDisconnected();
        } 
    }