Help Center
Local Navigation
- Creating user interfaces
- Storing data
- Creating connections
- Managing applications
- Using custom messages and folders in the message list
- Applications for push content
- Localizing BlackBerry device applications
- Controlling access to APIs and application data
- Testing a BlackBerry device application
- Packaging and distributing a BlackBerry Java Application
- Glossary
- Provide feedback
- Legal notice
BlackBerry Manuals & Help
>
Documentation for Developers
>
Java Development Guides and API Reference
>
Development Guide - BlackBerry Java Development Environment - 4.7.0
Remove a collection listener that notifies the system when a collection changes
When a CollectionListener is no longer required, the system invokes CollectionEventSource.removeCollectionListener.
- Import the following classes:
- Import the following interfaces:
- Implement the following interfaces:
- Implement the CollectionEventSource.removeCollectionListener() method, using the ListenerUtilities.removeListener() method to remove a CollectionListener from the Vector that contains SyncCollection listeners for the BlackBerry® device application.
In the following code sample, we implement CollectionEventSource.removeCollectionListener()
to invoke ListenerUtilities.removeListener() to remove a listener from the Vector that contains listeners
public void removeCollectionListener(Object listener) {_listeners = ListenerUtilities.removeListener( _listeners, listener ); }
Parent topic: Collections