3

How to Call Calendar in my Application using Intents?

Dipak Keshariya
  • 22,009
  • 18
  • 75
  • 127

2 Answers2

4

You need an Intent that looks something like this:

Intent calendarIntent = new Intent(Intent.ACTION_EDIT);  
calendarIntent.setType("vnd.android.cursor.item/event");
calendarIntent.putExtra("title", "Title");
calendarIntent.putExtra("beginTime", startTimeMillis);
calendarIntent.putExtra("endTime", endTimeMillis);
calendarIntent.putExtra("description", "Description");

You can then start it by calling this:

startActivity(calendarIntent);
nicholas.hauschild
  • 41,623
  • 9
  • 123
  • 118
  • And here are the available intents: http://developer.android.com/guide/topics/providers/calendar-provider.html#intents – Nuno Silva Dec 10 '14 at 15:03
0

Do you mean the calendar app or the form for adding a new event to the calendar?

Either way. Refer to this answer:

how can i open the calendar from my app?

Community
  • 1
  • 1
BFil
  • 12,726
  • 3
  • 42
  • 48