Added in API level 21
ContactsContract.SearchSnippets
public
static
class
ContactsContract.SearchSnippets
extends Object
| java.lang.Object | |
| ↳ | android.provider.ContactsContract.SearchSnippets |
Additional column returned by
Contacts.CONTENT_FILTER_URI explaining
why the filter matched the contact. This column will contain extracts from the contact's
constituent Data items, formatted in a way that indicates the section of the
snippet that matched the filter.
The following example searches for all contacts that match the query "presi" and requests the snippet column as well.
Builder builder = Contacts.CONTENT_FILTER_URI.buildUpon();
builder.appendPath("presi");
// Defer snippeting to the client side if possible, for performance reasons.
builder.appendQueryParameter(SearchSnippets.DEFERRED_SNIPPETING_KEY,"1");
Cursor cursor = getContentResolver().query(builder.build());
Bundle extras = cursor.getExtras();
if (extras.getBoolean(ContactsContract.DEFERRED_SNIPPETING)) {
// Do our own snippet formatting.
// For a contact with the email address (preside