这对我有用。
Uri contactData = data.getData();
Cursor c = main.managedQuery(contactData, null, null, null, null);
if (c.moveToFirst()) {
String contactId = c.getString(c.getColumnIndex(ContactsContract.Contacts._ID));
}
Cursor c1 = mcontext.getContentResolver().query(Data.CONTENT_URI,
new String[] {Data._ID, Phone.NUMBER, Phone.TYPE, Phone.LABEL},
Data.CONTACT_ID + "=?" + " AND "
+ Data.MIMETYPE + "='" + Phone.CONTENT_ITEM_TYPE + "'",
new String[] {String.valueOf(contactId)}, null);
c1.moveToFirst();
String number = c1.getString(1);
我从谷歌文档中得到了查询。您在第一个位置得到字符串,因为这是上面查询中的位置。
http://developer.android.com/reference/android/provider/ContactsContract.Data.html