Skip to content

Instantly share code, notes, and snippets.

@sakurabird
Created October 10, 2013 18:35
Show Gist options
  • Save sakurabird/6923255 to your computer and use it in GitHub Desktop.
Save sakurabird/6923255 to your computer and use it in GitHub Desktop.
(Android)Intentでカレンダーを呼び出し
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "!タイトル!"); // タイトル
intent.putExtra("description", "!内容!"); // 内容
intent.putExtra("eventLocation", "!場所!"); // 場所
Calendar cal = Calendar.getInstance();
// cal.set(2011, 4, 29, 20, 0);
intent.putExtra("beginTime", cal.getTimeInMillis()); // 開始日時
// cal.set(2011, 4, 29, 23, 0);
intent.putExtra("endTime", cal.getTimeInMillis()); // 終了日時
intent.putExtra("allDay", true); // 終日
startActivity(Intent.createChooser(intent, "カレンダーを選択してください"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment