Guest User

Untitled

a guest
Jun 19th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import android.provider.Contacts.People;
  2. import android.content.ContentUris;
  3. import android.net.Uri;
  4. import android.database.Cursor;
  5.  
  6. // Use the ContentUris method to produce the base URI
  7. // for the contact with _ID == 3.
  8. Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 3);
  9.  
  10. // Alternatively, use the Uri method to produce the base URI.
  11. // It takes a string rather than an integer.
  12. Uri myPerson = Uri.withAppendedPath(People.CONTENT_URI, "3");
  13.  
  14. // Then query for this specific record:
  15. Cursor cur = managedQuery(myPerson, null, null, null, null);
Add Comment
Please, Sign In to add comment