Notify a BlackBerry device application when the default list of calendar entries changes

When an update occurs to the list of services on a BlackBerry® device, the list of PIM databases on a device may change. This action may result in the creation of a new default list of calendar entries.

  1. Import the required classes and interfaces.
    import javax.microedition.pim.PIM;
    import net.rim.blackberry.api.pdap.BlackBerryPIM;
    import net.rim.blackberry.api.pdap.ListChangeListener;
    
  2. Implement the ListChangeListener interface.
    public class MyListChangeListener implements ListChangeListener {...}
  3. Invoke BlackBerryPIM.addListChangeListener() to register to receive notifications of changes to a default PIM list.
    ListChangeListener listener = new MyListChangeListener();
    ((BlackBerryPIM) PIM.getInstance()).addListChangeListener(listener);
  4. To have the application always use the default PIMList, store a reference to the desired PIMList and design the ListChangeListener.defaultListChanged() method to update the reference when the default list changes.

Was this information helpful? Send us your comments.