/** 读取联系人的信息*/
public voidtestReadAllContacts() {
Cursor cursor= this.getContext().getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,null, null, null, null);int contactIdIndex = 0;int nameIndex = 0;if(cursor.getCount() > 0) {
contactIdIndex=cursor.getColumnIndex(ContactsContract.Contacts._ID);
nameIndex=cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
}while(cursor.moveToNext()) {
String contactId=cursor.getString(contactIdIndex);
String name=cursor.getString(nameIndex);
Log.i(TAG, contactId);
Log.i(TAG, name);/** 查找该联系人的phone信息*/Cursor phones= this.getContext().getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID+ "=" +contactId,null, null);int phoneIndex = 0;if(phones.get