blob: 01274ae8d763058f71b91f47e6b64e5e18e29152 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
Copyright 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<!-- change minSdk if needed-->
This sample demonstrates how to use the Contactables table to search for contacts.
\n\nQuery strings sent to the Contactables table will match both contact names and phone numbers,
reducing the number of queries your application needs to use when searching the contacts database!
<template src="base"/>
<common src="logger"/>
This sample shows how to search for contacts, displaying a SearchView in the Action Bar for user input and implementing a query Cursor with CommonDataKinds.Contactables.
This sample displays a [SearchView][1] in the Action Bar when the search icon is clicked. It then implements the [LoaderManager.LoaderCallbacks][2] interface to query the contacts table, using a [CursorLoader][3].
For details on how to implement the [SearchView][1], refer to the training guide [Setting up the search interface][4].
For details on how to implement the [LoaderManager.LoaderCallbacks][2] interface, refer to the [Using the LoaderManager Callbacks][5] guide.
For details on how to query the contacts provider, refer to the [Contacts Provider Access][6] guide.