2

我想在特定日期和时间在应用程序内创建警报。它应该在时间过去时显示其描述,可以编辑。它应该只显示描述,不应包含其他详细信息,例如“标记为私人”、“电话会议”等。

4

1 回答 1

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

于 2010-12-06T08:27:11.003 回答