0
我對將事件添加到日曆中存在一些小問題。我試圖設置實際的事件開始日期,例如2013/09/25,但是當日歷打開時,它顯示我錯誤的開始日期事件2015/09/02。 PLZ幫助將事件添加到日曆中
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra(Events.TITLE, "Learn Android");
intent.putExtra(Events.EVENT_LOCATION, "xyz");
intent.putExtra(Events.DESCRIPTION, "xyz");
calDate1 = new GregorianCalendar(2013,
9, 25, 12, 00,
00);
intent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
calDate1.getTimeInMillis());
intent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
calDate1.getTimeInMillis());
intent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true);
intent.putExtra(Events.RRULE,
"FREQ=WEEKLY;COUNT=11;WKST=SU;BYDAY=TU,TH");
intent.putExtra(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);
intent.putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY);
startActivity(intent);
// ------------------------結果在日曆
from 02/09/2015
to 02/09/2015