Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intent that opens "new calendar event" activity

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?

like image 772
fhucho Avatar asked May 26 '10 09:05

fhucho


1 Answers

The problem was that I had a bug in my code - the value of eventEndInMillis was wrong and it was smaller then eventStartInMillis.

like image 130
fhucho Avatar answered Nov 05 '22 00:11

fhucho