Hi all,
I am developing an application wherein I need to set events to phones calendar (specifically remainder). I can able to set the events properly as per the below mention code and even the remainder pop up perfectly, but the problem here is when it pop up it does not play the remainder sound, and i have also checked that my mobile is not in silent mode. When i set the remainder manually it plays sound.
Is there any specific coding which i am missing here in my code to set the tone?
It will be a great help for me if any one can provide some code or information regarding this problem
public void setToNative(String a_dateTime)
{
//a_dateTime=20-10-2010|11:30:00
EventList eventList;
try
{
eventList = (EventList) PIM.getInstance().openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE, "Reminder");
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_MONTH, Integer.parseInt(a_dateTime.substring(0, 2)));
c.set(Calendar.MONTH, Integer.parseInt(a_dateTime.substring(3, 5)) - 1);
c.set(Calendar.YEAR, Integer.parseInt(a_dateTime.substring(6, 10)));
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(a_dateTime.substring(11, 13)));
c.set(Calendar.MINUTE, Integer.parseInt(a_dateTime.substring(14, 16)));
c.set(Calendar.SECOND, Integer.parseInt(a_dateTime.substring(17, 19)));
Event event = eventList.createEvent();
// Get data from controls
if(eventList.isSupportedField(Event.SUMMARY) == true)
{
event.addString(Event.SUMMARY, PIMItem.ATTR_NONE, a_text);
}
if(eventList.isSupportedField(Event.START) == true)
{
event.addDate(Event.START, PIMItem.ATTR_NONE,c.getTime().getTime());
}
if (eventList.isSupportedField(Event.ALARM))
{
event.addInt(Event.ALARM, PIMItem.ATTR_NONE, 0);
}
event.commit();
} catch(Exception pimExc) {
pimExc.printStackTrace();
}
}
Thanks.
Rajesh Chandra.

Reply With Quote

