Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 457: | Line 457: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
i = intent("android.intent.action.INSERT") | i = intent("android.intent.action.INSERT") // Create Intent object | ||
i.data("content://com.android.calendar/events") | i.data("content://com.android.calendar/events") // Data contains Google Calendar URI | ||
i.extra("title", entry().field("Title")) | i.extra("title", entry().field("Title")) // Get event name from field Title | ||
i.extra("description", entry().field("Description")) | i.extra("description", | ||
i.extraLong("beginTime", entry().field("Begin").getTime()) | entry().field("Description")) // Get description from field Description | ||
i.extraLong("beginTime", | |||
entry().field("Begin").getTime()) // Get start time from field Begin | |||
// 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.send() | i.extraLong("endTime", | ||
entry().field("End").getTime()) // Get end time from the field End | |||
// Requires same conversion as above | |||
i.send() // Send the message | |||
</source> | </source> | ||
== JavaScript links == | == JavaScript links == | ||
{{Template:JavaScriptLinks}} | {{Template:JavaScriptLinks}} |