我无法以编程方式更新日历活动详情。这是代码示例。任何帮助都应该非常感谢。
Uri CALENDAR_URI = Uri.parse("content://com.android.calendar/events");
Cursor c = context.getContentResolver().query(CALENDAR_URI, null, null, null, null);
String[] s = c.getColumnNames();
if (c.moveToFirst()) {
while (c.moveToNext()) {
String _id = c.getString(c.getColumnIndex("_id"));
String CalId = c.getString(c.getColumnIndex("calendar_id"));
if ((_id == null) && (CalId == null)) {
return false;
} else {
if (_id.equals(eventId) && CalId.equals(cal_Id)) {
Uri uri = ContentUris.withAppendedId(CALENDAR_URI, Integer.parseInt(_id));
ContentValues event = new ContentValues();
event.put(CalendarContract.Events.SELF_ATTENDEE_STATUS, statusId);
context.getContentResolver().update(uri, event, null, null);// need to give your data here
return true;
}
}
}
}