case R.id.et_person_call:// 调用通讯录的 按钮
Intent intent1 = new Intent(Intent.ACTION_PICK,android.provider.ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent1, 0);
@Override
protected void onActivityResult(int reqCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(reqCode, resultCode, data);
if (resultCode == Activity.RESULT_OK) {
ContentResolver reContentResolverol = getContentResolver();
Uri contactData = data.getData();
@SuppressWarnings("deprecation")
Cursor cursor = managedQuery(contactData, null, null, null, null);
cursor.moveToFirst();
String mPhoneName = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
String contactId = cursor.getString(cursor.getColumnIndex(BaseColumns._ID));
Cursor phone = reContentResolverol.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = " + contactId,
null,
null);
while (phone.moveToNext()) {
// System.err.println("===============================11111111111111111");
String mNumber = phone.getString(phone.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
et_name.setText(mPhoneName);
et_tel.setText(mNumber);
}
}
}