Skip to content

Most visited

Recently visited

navigation

CalendarContract.Instances

public static final class CalendarContract.Instances
extends Object implements BaseColumns, CalendarContract.EventsColumns, CalendarContract.CalendarColumns

java.lang.Object
   ↳ android.provider.CalendarContract.Instances


Fields and helpers for interacting with Instances. An instance is a single occurrence of an event including time zone specific start and end days and minutes. The instances table is not writable and only provides a way to query event occurrences.

Summary

Constants

String BEGIN

The beginning time of the instance, in UTC milliseconds.

String END

The ending time of the instance, in UTC milliseconds.

String END_DAY

The Julian end day of the instance, relative to the local time zone.

String END_MINUTE

The end minute of the instance measured from midnight in the local time zone.

String EVENT_ID

The _id of the event for this instance.

String START_DAY

The Julian start day of the instance, relative to the local time zone.

String START_MINUTE

The start minute of the instance measured from midnight in the local time zone.

Inherited constants

From interface android.provider.BaseColumns
From interface android.provider.CalendarContract.EventsColumns
From interface android.provider.CalendarContract.CalendarColumns

Fields

public static final Uri CONTENT_BY_DAY_URI

The content:// style URL for querying an instance range by Julian Day.

public static final Uri CONTENT_SEARCH_BY_DAY_URI

The content:// style URL for querying an instance range with a search term.

public static final Uri CONTENT_SEARCH_URI

The content:// style URL for querying an instance range with a search term.

public static final Uri CONTENT_URI

The content:// style URL for querying an instance range.

Public methods

static final Cursor query(ContentResolver cr, String[] projection, long begin, long end)

Performs a query to return all visible instances in the given range.

static final Cursor query(ContentResolver cr, String[] projection, long begin, long end, String searchQuery)

Performs a query to return all visible instances in the given range that match the given query.

Inherited methods

From class java.lang.Object

Constants

BEGIN

Added in API level 14
String BEGIN

The beginning time of the instance, in UTC milliseconds. Column name.

Type: INTEGER (long; millis since epoch)

Constant Value: "begin"

END

Added in API level 14
String END

The ending time of the instance, in UTC milliseconds. Column name.

Type: INTEGER (long; millis since epoch)

Constant Value: "end"

END_DAY

Added in API level 14
String END_DAY

The Julian end day of the instance, relative to the local time zone. Column name.

Type: INTEGER (int)

Constant Value: "endDay"

END_MINUTE

Added in API level 14
String END_MINUTE

The end minute of the instance measured from midnight in the local time zone. Column name.

Type: INTEGER (int)

Constant Value: "endMinute"

EVENT_ID

Added in API level 14
String EVENT_ID

The _id of the event for this instance. Column name.

Type: INTEGER (long, foreign key to the Events table)

Constant Value: "event_id"

START_DAY

Added in API level 14
String START_DAY

The Julian start day of the instance, relative to the local time zone. Column name.

Type: INTEGER (int)

Constant Value: "startDay"

START_MINUTE

Added in API level 14
String START_MINUTE

The start minute of the instance measured from midnight in the local time zone. Column name.

Type: INTEGER (int)

Constant Value: "startMinute"

Fields

CONTENT_BY_DAY_URI

Added in API level 14
Uri CONTENT_BY_DAY_URI

The content:// style URL for querying an instance range by Julian Day. The start and end day should be added as path segments if this is used directly.

CONTENT_SEARCH_BY_DAY_URI

Added in API level 14
Uri CONTENT_SEARCH_BY_DAY_URI

The content:// style URL for querying an instance range with a search term. The start day, end day, and search string should be appended as path segments if this is used directly.

CONTENT_SEARCH_URI

Added in API level 14
Uri CONTENT_SEARCH_URI

The content:// style URL for querying an instance range with a search term. The begin, end, and search string should be appended as path segments if this is used directly.

CONTENT_URI

Added in API level 14
Uri CONTENT_URI

The content:// style URL for querying an instance range. The begin and end of the range to query should be added as path segments if this is used directly.

Public methods

query

Added in API level 14
Cursor query (ContentResolver cr, 
                String[] projection, 
                long begin, 
                long end)

Performs a query to return all visible instances in the given range. This is a blocking function and should not be done on the UI thread. This will cause an expansion of recurring events to fill this time range if they are not already expanded and will slow down for larger time ranges with many recurring events.

Parameters
cr ContentResolver: The ContentResolver to use for the query
projection String: The columns to return
begin long: The start of the time range to query in UTC millis since epoch
end long: The end of the time range to query in UTC millis since epoch
Returns
Cursor A Cursor containing all instances in the given range

query

Added in API level 14
Cursor query (ContentResolver cr, 
                String[] projection, 
                long begin, 
                long end, 
                String searchQuery)

Performs a query to return all visible instances in the given range that match the given query. This is a blocking function and should not be done on the UI thread. This will cause an expansion of recurring events to fill this time range if they are not already expanded and will slow down for larger time ranges with many recurring events.

Parameters
cr ContentResolver: The ContentResolver to use for the query
projection String: The columns to return
begin long: The start of the time range to query in UTC millis since epoch
end long: The end of the time range to query in UTC millis since epoch
searchQuery String: A string of space separated search terms. Segments enclosed by double quotes will be treated as a single term.
Returns
Cursor A Cursor of instances matching the search terms in the given time range
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.