Skip to content

Instantly share code, notes, and snippets.

@skatldjs
Created October 22, 2010 01:28
Show Gist options
  • Select an option

  • Save skatldjs/639744 to your computer and use it in GitHub Desktop.

Select an option

Save skatldjs/639744 to your computer and use it in GitHub Desktop.
import android.provider.Contacts.People;
import android.content.ContentUris;
import android.net.Uri;
import android.database.Cursor;
// Use the ContentUris method to produce the base URI
// for the contact with _ID == 3.
Uri myPerson = ContentUris.withAppendedId(People.CONTENT_URI, 3);
// Alternatively, use the Uri method to produce the base URI.
// It takes a string rather than an integer.
Uri myPerson = Uri.withAppendedPath(People.CONTENT_URI, "3");
// Then query for this specific record:
Cursor cur = managedQuery(myPerson, null, null, null, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment