- String[] projection = new String[] {
- People._ID,
- People.NAME,
- People.NUMBER,
- };
-
- Uri contactUri = People.CONTENT_URI;
-
- Cursor peopleCursor = managedQuery (contactUri,
- projection,
- null,
- null,
- People.DEFAULT_SORT_ORDER);
-
- peopleCursor.moveToFirst();
-
-
-
- long personId = peopleCursor.getLong(peopleCursor.getColumnIndex("_id"));
-
- Uri personUri = ContentUris.withAppendedId(contactUri, personId );
-
- Uri phoneUri=
- Uri.withAppendedPath(personUri, Contacts.People.Phones.CONTENT_DIRECTORY);
-
-
- Cursor phonesCursor = managedQuery(phoneUri,
- null,
- null,
- null,
- Phones.DEFAULT_SORT_ORDER);
-
- phonesCursor.moveToFirst();
|