Hi,
I want to write an application that interacts with User's calendar.
I want to get notified when an event is added, updated and deleted.
I have added PIMListListener for EVENT_LIST as
listContact = (BlackBerryPIMList)
PIM.getInstance().
openPIMList(PIM.CONTACT_LIST,
PIM.READ_WRITE);
listEvent = (BlackBerryPIMList)
PIM.getInstance().
openPIMList(PIM.EVENT_LIST ,
PIM.READ_WRITE);
listenerContact = new SContactListener ();
listenerEvent = new SEventListener ();
statusField = new RichTextField("",Field.NON_FOCUSABLE) ;
appScreen = new AppScreen() ;
listContact.addListener(listenerContact) ;
listEvent.addListener(listenerEvent) ;
==========================
public class SEventListener implements PIMListListener{
public static final char RECORD_STATE_DELETED = 'D' ;
//Data store object
private EventDataStore eventDataStore ;
/**
* Default Constructor for Sync4jPIMListener class
* that initializes the store object.
*
* @param void
*
*/
public Sync4jEventListener() {
System.out.println("debug --------------->>>>>>>>>>>>00000000000 -
e");
this.eventDataStore = new EventDataStore();
System.out.println("debug --------------->>>>>>>>>>>>00000000000' -
e");
}
/**
* This method is invoked when the item is added to blackberry
addressbook.
* @param PIMItem ,item that was added to the address book
* @return void
*/
public void itemAdded(PIMItem item) {
System.out.println("debug --------------->>>>>>>>>>>>11111 - e");
storeRecord(item, EventDataStore.RECORD_STATE_NEW);
}
/**
* This method is invoked when the item is updated in blackberry
addressbook.
* @param PIMItem oldItem, item that was changed from the address book
* @param PIMItem newItem, item that is changed from the address book
* @return void
*/
public void itemUpdated(PIMItem oldItem, PIMItem newItem) {
System.out.println("debug --------------->>>>>>>>>>>>222222 - e");
storeRecord(newItem, EventDataStore.RECORD_STATE_UPDATED);
}
.............................
But when I add a new Calendar, this is not notificated to itemAdded(...) in
SEventListener.
Why?
A know issue in
net.rim.blackberry.api.pdap.PIMListListener
javax.microedition.pim.PIM
?
I use JDE 4.0 and default simulator.
Thanks & thanks for any suggestion.
Fabio
--
Sync4j - the open source SyncML mobile application platform -
www.sync4j.org