Calendars

class Calendars : BaseColumns, CalendarContract.SyncColumns, CalendarContract.CalendarColumns
kotlin.Any
   ↳ android.provider.CalendarContract.Calendars

Constants and helpers for the Calendars table, which contains details for individual calendars. Operations All operations can be done either as an app or as a sync adapter. To perform an operation as a sync adapter #CALLER_IS_SYNCADAPTER should be set to true and #ACCOUNT_NAME and #ACCOUNT_TYPE must be set in the Uri parameters. See Uri.Builder#appendQueryParameter(java.lang.String, java.lang.String) for details on adding parameters. Sync adapters have write access to more columns but are restricted to a single account at a time. Calendars are designed to be primarily managed by a sync adapter and inserting new calendars should be done as a sync adapter. For the most part, apps should only update calendars (such as changing the color or display name). If a local calendar is required an app can do so by inserting as a sync adapter and using an #ACCOUNT_TYPE of #ACCOUNT_TYPE_LOCAL . Insert When inserting a new calendar the following fields must be included:

The following fields are not required when inserting a Calendar but are generally a good idea to include: Update To perform an update on a calendar the #_ID of the calendar should be provided either as an appended id to the Uri ( ContentUris#withAppendedId) or as the first selection item--the selection should start with "_id=?" and the first selectionArg should be the _id of the calendar. Calendars may also be updated using a selection without the id. In general, the #ACCOUNT_NAME and #ACCOUNT_TYPE should not be changed after a calendar is created as this can cause issues for sync adapters. Delete Calendars can be deleted either by the #_ID as an appended id on the Uri or using any standard selection. Deleting a calendar should generally be handled by a sync adapter as it will remove the calendar from the database and all associated data (aka events). Query Querying the Calendars table will get you all information about a set of calendars. There will be one row returned for each calendar that matches the query selection, or at most a single row if the #_ID is appended to the Uri. Calendar Columns The following Calendar columns are writable by both an app and a sync adapter. The following Calendars columns are writable only by a sync adapter
Requires API level 14 (Android 4.0, IceCreamSandwich)

Summary

Constants
static String

The default location for the calendar.

static String

The default sort order for this table
Requires API level 14 (Android 4.0, IceCreamSandwich)

static String

The name of the calendar.

Inherited constants
Properties
static Uri!

The content:// style URL for accessing Calendars
Requires API level 14 (Android 4.0, IceCreamSandwich)

Constants

CALENDAR_LOCATION

added in API level 14
static val CALENDAR_LOCATION: String

The default location for the calendar. Column name.

Type: TEXT


Requires API level 14 (Android 4.0, IceCreamSandwich)
Value: "calendar_location"

DEFAULT_SORT_ORDER

added in API level 14
static val DEFAULT_SORT_ORDER: String

The default sort order for this table
Requires API level 14 (Android 4.0, IceCreamSandwich)

Value: "calendar_displayName"

NAME

added in API level 14
static val NAME: String

The name of the calendar. Column name.

Type: TEXT


Requires API level 14 (Android 4.0, IceCreamSandwich)
Value: "name"

Properties

CONTENT_URI

added in API level 14
static val CONTENT_URI: Uri!

The content:// style URL for accessing Calendars
Requires API level 14 (Android 4.0, IceCreamSandwich)