Saturday, 8 May 2021

Android populate google calendar attachment field with intent

In my app I am building an intent for the user to create a calendar event with some basic information:

fun build(): Intent = Intent(Intent.ACTION_INSERT).apply {
    type = "vnd.android.cursor.item/event"
    putExtra(CalendarContract.Events.TITLE, title)
    putExtra(CalendarContract.Events.DESCRIPTION, description)
    putExtra(CalendarContract.Events.EVENT_LOCATION, location)
    putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, startTime)
    putExtra(CalendarContract.EXTRA_EVENT_END_TIME, endTime)
    putExtra(CalendarContract.Events.ALL_DAY, true)
}

launching this intent prompts the user to select a calendar app to handle this action. For google calendar there is an "attachment" field that references a google drive link:

calendar attachment

Is there any way to pass a google drive link for this field from my app to populate it when shown to the user?

(I realize this can be done with the calendar API but want to do it without user authorization)



from Android populate google calendar attachment field with intent

No comments:

Post a Comment