Created
October 22, 2010 01:34
-
-
Save skatldjs/639749 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.provider.Contacts.People; | |
| import android.database.Cursor; | |
| String[] projection = new String[] {People._ID, | |
| People._COUNT, | |
| People.NAME, | |
| People.NUMBER }; | |
| // Get the base URI for the People table | |
| // in the Contacts content provider. | |
| Uri contacts = People.CONTENT_URI; | |
| // Make the query. | |
| Cursor managedCursor = managedQuery(contacts, | |
| projection, // Which columns to return | |
| null, // Which rows to return (all rows) | |
| null, // Selection arguments (none) | |
| People.NAME + "ASC"); // Put the results in ascending order by name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment