3

How to Call Calendar in my Application using Intents?

Dipak Keshariya
  • 22,193
  • 18
  • 76
  • 128

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
  • 42,483
  • 9
  • 127
  • 120
  • 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,966
  • 3
  • 44
  • 48