Hi,
I'm trying to make an application that can add Event to build-in Calendar. For this purpose, I use J2ME PIM Profile. For adding event to Calendar, it can be done successfuly. But when I try to remove event in Calendar that I had add via application, it still cannot be done.
I use this code to remove the event :
try {
pim = PIM.getInstance();
et = (EventList) pim.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
event = et.createEvent();
for (Enumeration el = et.items(EventList.OCCURRING, myTime-1, myTime+1, false); el.hasMoreElements(); ){
event = (Event)el.nextElement();
if (et.isSupportedField(Event.SUMMARY))
event.removeValue (Event.SUMMARY, 0);
if (et.isSupportedField(Event.START))
event.removeValue (Event.START, 0);
if (et.isSupportedField(Event.END))
event.removeValue (Event.END, 0);
if (et.isSupportedField(Event.ALARM))
event.removeValue (Event.ALARM, 0);
if (et.isSupportedField(Event.NOTE))
event.removeValue (Event.NOTE, 0);
System.out.println ("commiting");
event.commit();
et.removeEvent(event);
si.setText ("remove success");
}
et.close();
}
catch (Exception e) {
System.out.println ("Exception : " + e.toString());
si.setText (e.toString() + " : " + x);
}
Does anyone has experience in PIM API? Help me to get the answer of my problem, please....
Thank you....

Reply With Quote


