|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.nokia.mid.pim.ContactChangeManager
public class ContactChangeManager
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 |
---|
public ContactChangeManager()
Method Detail |
---|
public static void addChangeListener(ContactChangeListener listener)
listener
- the contact change listener to addpublic static void removeChangeListener(ContactChangeListener listener)
listener
- the contact change listener to remove
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |