您可以使用日历视图来执行此操作...使用该setDate(long date)
方法将日历上的日期设置为您想要的日期
您也可以通过像这样将事件添加到日历来做到这一点
创建日历的意图
Intent calIntent = new Intent(Intent.ACTION_INSERT);
calIntent.setData(CalendarContract.Events.CONTENT_URI);
startActivity(calIntent)
播种日历日期和时间
Intent calIntent = new Intent(Intent.ACTION_INSERT);
calIntent.setType("vnd.android.cursor.item/event");
calIntent.putExtra(Events.TITLE, "Title here");
calIntent.putExtra(Events.EVENT_LOCATION, "Location here");
calIntent.putExtra(Events.DESCRIPTION, "Description here");
GregorianCalendar calDate = new GregorianCalendar(2012, 7, 15);
calIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, true);
calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
calDate.getTimeInMillis());
calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
calDate.getTimeInMillis());
startActivity(calIntent);
可以在这里看到一个例子