Created
October 10, 2013 18:35
-
-
Save sakurabird/6923255 to your computer and use it in GitHub Desktop.
(Android)Intentでカレンダーを呼び出し
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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