views:

560

answers:

1

In my app, I want a functionality to create calendar event. I open "new calendar event" activity like this:

Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "Some title");
intent.putExtra("description", "Some description");
intent.putExtra("beginTime", eventStartInMillis);
intent.putExtra("endTime", eventEndInMillis);
startActivity(intent);

It works perfectly on stock Android. On HTC Sense, I have only one issue - end time is not set correctly, it's always one hour after begin time. What can be the problem?

A: 

this tutorial shows how to add calendar events without opening an activity. http://android.arnodenhond.com/tutorials/calendar it does save the end time properly though (and it seems to work on htc devices only)

arnodenhond