How to Call the Calendar Application in BlackBerry

final EventList eventLst = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.WRITE_ONLY);

final Event event = eventLst.createEvent();

event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, "Sample");

event.addBoolean(BlackBerryEvent.ALLDAY, PIMItem.ATTR_NONE, true);

event.addDate(Event.START, PIMItem.ATTR_NONE, new Date().getTime());

event.addInt(Event.ALARM, PIMItem.ATTR_NONE, 900); // 15 min

final RepeatRule repeat = new RepeatRule();

repeat.setInt(RepeatRule.FREQUENCY, RepeatRule.YEARLY);

event.setRepeat(repeat);

Invoke.invokeApplication(Invoke.APP_TYPE_CALENDAR, new CalendarArguments(CalendarArguments.ARG_NEW, event));

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s