Contract for use with the Gmail content provider.
Developers can use this content provider to display label information to the user.
The label information includes:
- Label name
- Total number of conversations
- Number of unread conversations
- Label text color
- Label background color
This content provider is available in Gmail version 2.3.6 or newer for Froyo/Gingerbread and version 4.0.5 and newer for Honeycomb and Ice Cream Sandwich
An application can query the Content Resolver directly (or use a Loader) to obtain a Cursor with information for all labels on an account
Cursor labelsCursor = getContentResolver().query(GmailContract.Labels.getLabelsUri(
selectedAccount), null, null, null, null);
Nested Classes | ||
---|---|---|
GmailContract.Labels |
Constants | ||
---|---|---|
AUTHORITY | ||
PERMISSION |
Public Methods | ||
---|---|---|
Constants
public static final String AUTHORITY
Authority for the Gmail content provider.
public static final String PERMISSION
Permission required to access this android.content.ContentProvider
Public Methods
public static boolean canReadLabels (Context c)
Check if the installed Gmail app supports querying for label information.
Parameters
c | an application Context |
Returns
- true if it's safe to make label API queries
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-03 UTC.