Write, Bureaucrats, Administrators
4,332
edits
mNo edit summary |
mNo edit summary |
||
Line 467: | Line 467: | ||
<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", | i.extra("description", | ||
entry().field("Description")) | entry().field("Description")); // Get description from field Description | ||
i.extraLong("beginTime", | i.extraLong("beginTime", | ||
entry().field("Begin").getTime()) | entry().field("Begin").getTime()); // Get start time from field Begin | ||
// Begin is of type DateTime | // Begin is of type DateTime | ||
// Additional parameter is of type Long, | // Additional parameter is of type Long, | ||
// so extraLong() is used for conversion. | // so extraLong() is used for conversion. | ||
i.extraLong("endTime", | i.extraLong("endTime", | ||
entry().field("End").getTime()) | entry().field("End").getTime()); // Get end time from the field End | ||
// Requires same conversion as above | // Requires same conversion as above | ||
i.send() | i.send(); // Send the message | ||
</source> | </source> | ||
== JavaScript links == | == JavaScript links == | ||
{{Template:JavaScriptLinks}} | {{Template:JavaScriptLinks}} |