Time for action - adding an event to the calendar

  1. Add the following code to the addEvent method.
    PIM pim = PIM.getInstance(); EventList events; try { events = (EventList)pim.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE); BlackBerryEvent newEvent = (BlackBerryEvent) events.createEvent(); newEvent.addString(BlackBerryEvent.SUMMARY, BlackBerryEvent.ATTR_NONE, "Requested time off."); newEvent.addString(BlackBerryEvent.LOCATION, BlackBerryEvent.ATTR_NONE, "Special place"); newEvent.addDate(BlackBerryEvent.START, BlackBerryEvent.ATTR_NONE, _StartDate.getDate()); newEvent.addDate(BlackBerryEvent.END, BlackBerryEvent.ATTR_NONE, _EndDate.getDate()); newEvent.addString(BlackBerryEvent.NOTE, BlackBerryEvent.ATTR_NONE, _Comments.getText()); newEvent.addBoolean(BlackBerryEvent.ALLDAY, ...

Get BlackBerry Java Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.