Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 451: | Line 451: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
i = intent("android.intent.action.INSERT") // Create Intent object with action Create Appointment | i = intent("android.intent.action.INSERT") // Create Intent object with action Create Appointment | ||
i.data("content://com.android.calendar/events") // For INSERT event, data contains Google | i.data("content://com.android.calendar/events") // For INSERT event, data contains Google Cal URI | ||
i.extra("title", entry().field("Title")) // Get name of event from the field Title | i.extra("title", entry().field("Title")) // Get name of event from the field Title | ||
i.extra("description" , entry().field("Description")) | i.extra("description", entry().field("Description")) // Get description from the field Description | ||
i.extraLong("beginTime" , entry().field("Begin").getTime()) // Get start time from the field Begin. Begin is of type DateTime. | i.extraLong("beginTime", entry().field("Begin").getTime()) // Get start time from the field Begin. | ||
// Additional parameter is of type Long, so extraLong() is used for conversion. | // Begin is of type DateTime. | ||
i.extraLong("endTime" , entry().field("End").getTime()) | // Additional parameter is of type Long, | ||
// so extraLong() is used for conversion. | |||
i.extraLong("endTime", entry().field("End").getTime()) // Get end time from the field End. | |||
// Requires same conversion as above. | |||
i.send() // Send the message | i.send() // Send the message | ||
</source> | </source> |