GmailContract.Labels

public static final class GmailContract.Labels

Table containing label information.

Constants

public static final String BACKGROUND_COLOR

This integer value is the label's background color in 32-bit 0xAARRGGBB format.

Type: INTEGER

Constant Value: "background_color"

public static final String CANONICAL_NAME

This string value is the canonical name of a label. Canonical names are not localized and are not user-facing.

Type: TEXT

Constant Value: "canonicalName"

public static final String CONTENT_ITEM_TYPE

The MIME-type of a label item.

Constant Value: "vnd.android.cursor.item/vnd.com.google.android.gm.label"

public static final String CONTENT_TYPE

The MIME-type of uri providing a directory of label items.

Constant Value: "vnd.android.cursor.dir/vnd.com.google.android.gm.label"

public static final String NAME

This string value is the user-visible name of a label. Names of system labels (Inbox, Sent, Drafts...) are localized.

Type: TEXT

Constant Value: "name"

public static final String NUM_CONVERSATIONS

This integer value is the number of conversations in this label.

Type: INTEGER

Constant Value: "numConversations"

public static final String NUM_UNREAD_CONVERSATIONS

This integer value is the number of unread conversations in this label.

Type: INTEGER

Constant Value: "numUnreadConversations"

public static final String TEXT_COLOR

This integer value is the label's foreground text color in 32-bit 0xAARRGGBB format.

Type: INTEGER

Constant Value: "text_color"

public static final String URI

This string column value is the uri that can be used in subsequent calls to android.content.ContentProvider#query() to query for information on the single label represented by this row.

Type: TEXT

Constant Value: "labelUri"

Public Methods

public static Uri getLabelsUri (String account)

Returns a URI that, when queried, will return the list of labels for an account.

To use the Labels API, an app must first find the email address of a valid Gmail account to query for label information. The AccountManager can return this information (example).

Parameters
account Name of a valid Google account.
Returns
  • The URL that can be queried to retrieve the the label list.