开发者

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

开发者 https://www.devze.com 2023-01-28 20:30 出处:网络
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 on

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

精彩评论

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