开发者

How to create a reminder using Alarm which can be editable in future

I want to create alarm inside an application at a particular Date & Time. It should display its desc开发者_开发知识库ription when it's time elapses which can be editable. And it should display only description and should not contain other details such as "Mark As Private", "Conference Call" etc..


Alarm is a type if Event. To retrieve events you should use the following:

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

Then use method items(int searchType, long startDate, long endDate, boolean initialEventOnly) to iterate over events:

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;
    }
}

For more information refer to

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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜