com.nokia.mid.pim
Class ContactChangeManager

java.lang.Object
  extended by com.nokia.mid.pim.ContactChangeManager

public class ContactChangeManager
extends java.lang.Object

ContactChangeManger is used to manage receiving contact changes when requester application is running or history contact change when it is not running

If requester application want to receive contact changes when it is running, it can register a ContactChangeListener to receive notification when there is any contact change

Note: when receive delete contact event, because the contact is already deleted, there is no way to get contact list name, the contact list name in onContactChange is invalid.

Code example as below
class MyClass extends MIDlet implements ContactChangeListener {
    public onContactChange(ContactChane[] changes) {
       for(int i = 0; i < changes.length; ++i) {
           System.out.println("Index " + i + " contact UID = " + changes[i].contactUID);
           System.out.println("Index " + i + " contact list name = " + changes[i].contactListName);
           System.out.println("Index " + i + " contact change type = " + changes[i].changeType);
       }
    }

    public startApp () {
      ContactChangeManager.addChangeListener(this);
    }
}

If requester application want to receive contact changes when is not running, before exit it can send request to platform record those contact changes and receive those changes after it is launched next time. In this case, requester application should also register a ContactChangeListener to receive those changes before request platform send back those recorded contact changes.


Constructor Summary
ContactChangeManager()
           
 
Method Summary
static void addChangeListener(ContactChangeListener listener)
          add a contact change listener
static void removeChangeListener(ContactChangeListener listener)
          remove a contact list change listener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactChangeManager

public ContactChangeManager()
Method Detail

addChangeListener

public static void addChangeListener(ContactChangeListener listener)
add a contact change listener

Parameters:
listener - the contact change listener to add

removeChangeListener

public static void removeChangeListener(ContactChangeListener listener)
remove a contact list change listener

Parameters:
listener - the contact change listener to remove