Android: Add entry to the calendar
I am trying to add entry to the calendar,but it threwn error.
Source code:
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("title", "test");
开发者_StackOverflow中文版 intent.putExtra("description", "Popis");
intent.putExtra("eventLocation", "Somewhere");
intent.putExtra("beginTime", System.currentTimeMillis () + 60 * 60 * 1000);
intent.putExtra("endTime", System.currentTimeMillis () + 2 * 60 * 60 * 1000);
startActivity(intent);
Sorry for my English i am beginner. Thanks for answer.
Add the WRITE_CALENDAR use-permission in your AndroidManifest.xml
精彩评论