Remove a calendar entry with no notification
You can remove a calendar entry on a
BlackBerry® device
without sending notifications to the entry's participants.
-
Import the required classes and interfaces.
import java.util.*;
import javax.microedition.pim.*;
import net.rim.blackberry.api.pdap.BlackBerryEvent;
import net.rim.blackberry.api.pdap.BlackBerryEventList;
-
Invoke
PIM.openPIMList() to open a list of calendar entries
as a
BlackBerryEventList object.
BlackBerryEventList eventList = null;
try
{
eventList = (BlackBerryEventList)
PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
}
catch (PIMException e)
{
// Handle exception
}
-
Retrieve a
BlackBerryEvent object from the list of entries.
Enumeration events = eventList.items();
BlackBerryEvent event = (BlackBerryEvent) events.nextElement();
-
Invoke
BlackBerryEventList.removeElement() and specify the
flag
BlackBerryEvent.DO_NOT_NOTIFY_ATTENDEES to remove
the entry without notification.
try
{
eventList.removeEvent(event, BlackBerryEvent.DO_NOT_NOTIFY_ATTENDEES);
}
catch (PIMException e)
{
// handle exception
{
If an error occurs when you try to remove the event, the method
throws a
PIMException.
Code sample
BlackBerryEventList eventList = null;
try
{
eventList = (BlackBerryEventList)
PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE);
Enumeration events = eventList.items();
BlackBerryEvent event = (BlackBerryEvent) events.nextElement();
eventList.removeEvent(event, BlackBerryEvent.DO_NOT_NOTIFY_ATTENDEES);
}
catch (PIMException e)
{
// Handle exception
}
Was this information helpful? Send us your comments.