Guest User

Untitled

a guest
Jun 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import android.provider.Contacts.People;
  2. import android.database.Cursor;
  3.  
  4. String[] projection = new String[] {People._ID,
  5. People._COUNT,
  6. People.NAME,
  7. People.NUMBER };
  8.  
  9. // Get the base URI for the People table
  10. // in the Contacts content provider.
  11. Uri contacts = People.CONTENT_URI;
  12.  
  13. // Make the query.
  14. Cursor managedCursor = managedQuery(contacts,
  15. projection, // Which columns to return
  16. null, // Which rows to return (all rows)
  17. null, // Selection arguments (none)
  18. People.NAME + "ASC"); // Put the results in ascending order by name
Add Comment
Please, Sign In to add comment