我想在特定日期和时间在应用程序内创建警报。它应该在可以编辑的时间过去时显示其描述。它应该只显示描述,不应该包含其他细节,如“标记为私有(private)”、“电话 session ”等。
最佳答案
Alarm 是一种 if Event。要检索事件,您应该使用以下内容:
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
关于java - 如何使用将来可以编辑的警报创建提醒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4364103/