Tag: contacts

从android联系人select器获取联系信息

我正在尝试拨打联系人select器,将人员姓名,电话和电子邮件转换为string,并使用意向将其发送到其他活动。 到目前为止这工作: Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, 1); // … @Override public void onActivityResult(int reqCode, int resultCode, Intent data) { super.onActivityResult(reqCode, resultCode, data); if (resultCode == Activity.RESULT_OK) { Uri contactData = data.getData(); Cursor c = managedQuery(contactData, null, null, null, null); if (c.moveToFirst()) { String name = c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts.DISPLAY_NAME)); Intent intent = new Intent(CurrentActivity.this, NewActivity.class); […]