I am trying to add the following date and time in my android calendars event....
Title and description = Events for test
Start Date = May 05, 2012, 07:10PM
End Date = May 06, 2012, 02:10PM
Following is my code to add to events
long startTime = 0, endTime = 0;
Date d = new Date();
startTime = d.parse(start);
d.setTime(startTime);
endTime = d.parse(end);
d.setTime(endTime);
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra(Events.TITLE, summary);
intent.putExtra(Events.DESCRIPTION, summary);
intent.putExtra(Events.EVENT_LOCATION, "");
intent.putExtra(Events.DTSTART, startTime);
intent.putExtra(Events.DTEND, endTime);
intent.putExtra(Events.ALL_DAY, allDayFlag);
intent.putExtra(Events.STATUS, 1);
intent.putExtra(Events.VISIBLE, 0);
intent.putExtra(Events.HAS_ALARM, 1);
startActivity(intent);
But in the Event details page i am getting the title, description alone to be in correct. In the place of start and end date i am getting the current date where as the start and end time to be of next 1 hr time.
Can anyone say me whats going wrong in my code.....