There are many examples on how to create a new calendar event in android but none on how to open and display an event. This is my code so far
public static void startCalendarMimeType(Context context, CalendarItem item){
//all version of android
Intent i = new Intent();
// mimeType will popup the chooser any for any implementing application (e.g. the built in calendar or applications such as "Business calendar"
i.setType("vnd.android.cursor.item/event");
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// the time the event should start in millis. This example uses now as the start time and ends in 1 hour
//i.putExtra("beginTime", item.getBegin());
//i.putExtra("endTime", item.getEnd());
i.putExtra("_id", item.getId());
// the action
//i.setAction(Intent.ACTION_PICK);
context.startActivity(i);
}
The Calendar item contains information already retrieved from the calendar using the content resolver. When a user clicks on my item I want it to open the Android calendar displaying the item.
At this point you can select an app to open with, If you choose "Show Event" it does open the calendar app but gets a nullpointer exception and I just can't figure out what I'm doing wrong here. I'm I the first who try's to do this?
Any help very much appreciated