java me - BlackBerry - How to create alarm event? -


I want to add an alarm In my application, I have successfully used the calendar and set the appointment but how do I access the alarm I can do Please help me. The following is my code

  public class alarms {private event event; Public Zero myAlarm () {try {eventList eventList = (EventList) PIM.getInstance () OpenPIMList (PIM.EVENT_LIST, PIM.WRITE_ONLY); Event = eventList.createEvent (); Event.addString (event.SUMMARY, PIMItem.ATTR_NONE, "My alarm"); Event.addString (event.LOCATION, PIMItem.ATTR_NONE, "My Location"); Event.addDate (event.END, PIMItem.ATTR_NONE, System.currentTimeMillis () + 360000); Event.addDate (event.START, PIMItem.ATTR_NONE, System.currentTimeMillis () + 120000); Event.commit (); } // block block (exception e) {}} // method of myAlarm} / / end of main class alarm /  

  eventlight evList = (EventList) PIM.getInstance (). OpenPIMList (PIM.EVENT_LIST, PIM.READ_WRITE); BlackBerryEvent ev = (BlackBerryEvent) evList.createEvent (); If (evList.isSupportedField (BlackBerryEvent.ALARM)) {ev.addInt (BlackBerryEvent.ALARM, BlackBerryEvent.ATTR_NONE, 180); // 3 minutes = 180 // If this field has a value of 180, then the alarm is first done in 180 seconds before the date / time value specified by event.START}  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -