こんにちは私は calendar を処理することになっている Android アプリを開発しています。自分のカレンダーにイベントを追加できません。次のコードを使用しました。そのコードを使用して、デフォルトのカレンダーにイベントを追加できます..アプリのカレンダーにイベントを追加するためにコードに必要な変更を提案してください
private void addevent() {
// TODO Auto-generated method stub
Intent calIntent = new Intent(Intent.ACTION_INSERT);
calIntent.setType("vnd.android.cursor.item/event");
calIntent.putExtra(Events.TITLE, "My House Party");
calIntent.putExtra(Events.EVENT_LOCATION, "My Beach House");
calIntent.putExtra(Events.DESCRIPTION, "A Pig Roast on the Beach");
GregorianCalendar calDate = new GregorianCalendar(2013, 4, 16);
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);
Toast.makeText(this, "event added", Toast.LENGTH_SHORT).show();
}