2010-12-06 83 views

回答

1

报警是一种类型,如果事件。要检索事件,你应该使用下列内容:

EventList list = (EventList)PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE); 

然后使用方法items(int searchType, long startDate, long endDate, boolean initialEventOnly)迭代事件:

for(Enumeration e = list.items(EventList.STARTING, startDate, endDate, false); e.hasMoreElements;) { 
    Event event = (Event)e.nextElement(); 
    if (sholdBeChanged()) { 
     Event event2 = list.createEvent(); 
     // initialize fields of event2. Probably copy them from event 
     list.removeEvent(event); 
     break; 
    } 
} 

欲了解更多信息,请参阅

http://developers.sun.com/mobility/apis/articles/pim/index.html

http://www.jcp.org/en/jsr/detail?id=75

+0

它不需要一个“event.commit( )“休息”之前的声明? – 2011-01-17 13:45:16