I made this code:
long eventID = 208;
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_VIEW)
.s
This may help you!!! http://developer.android.com/guide/topics/providers/calendar-provider.html
on Android 4.2.2, seems still having the same problem. Is it the correct behavior, or some thing missing here?
got the event id through Instances.query(Globals.sContext.getContentResolver(), proj, begin, end); proj= String[]{Instances.EVENT_ID, Instances.BEGIN, Instances.END...};
use the even id to view the event in calendar app.
tried with code (from http://developer.android.com/guide/topics/providers/calendar-provider.html), it still shows December 31 1969 on the 'Detail view' opened by the 'intent'; and shows current date in the 'Edit event' form if clicking on the the event on the 'Detail view' of the calendar.
...
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventID);
Intent intent = new Intent(Intent.ACTION_VIEW)
.setData(uri);
startActivity(intent);
and still does not work even with the:
intent.putExtra("beginTime", from);
intent.putExtra("endTime", till); //'from', 'till' is the mills got from the Instances.BEGIN/END fields from the query
EDIT:
the following code works. only difference is using the define CalendarContract.EXTRA_EVENT_BEGIN_TIME
Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, eventId);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, from);
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, till);
startActivity(intent);
You have to add the event begin & end time to intent's extra data :
intent.putExtra("beginTime", beginMilliTS);
intent.putExtra("endTime", endMilliTS);
I got this working by using the values from "begin" and "end" field of an event instance. This should work too with "dtstart" and "dtend" field from an event.