1
爲什麼日曆Evens表中的持續時間列未通過提供者獲取值集?Android日曆事件持續時間(API)
ContentValues event = new ContentValues();
if(allDay==1) {
long days = (dtend - dtstart + DateUtils.DAY_IN_MILLIS - 1)/DateUtils.DAY_IN_MILLIS;
event.put("duration", "P" + days + "D");
} else {
event.put("duration", "P" + ((dtend-dtstart)/DateUtils.SECOND_IN_MILLIS) + "S");
}
Uri eventsUri =Uri.parse("content://com.android.calendar/events")
cr.insert(eventsUri, event);