Skip to content

Instantly share code, notes, and snippets.

@slxny
Created April 10, 2017 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slxny/49154c656a5e59219e03431247f00514 to your computer and use it in GitHub Desktop.
Save slxny/49154c656a5e59219e03431247f00514 to your computer and use it in GitHub Desktop.
Intent intent = new Intent(Intent.ACTION_INSERT)
.setData(CalendarContract.Events.CONTENT_URI)
.putExtra(CalendarContract.Events.TITLE, title)
.putExtra(CalendarContract.Events.EVENT_LOCATION, location)
.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, begin)
.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, end);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment