在这里,获取电话号码以从联系人列表中检索电话号码的代码。它适用于“名称”。但我无法获得电话号码请给我代码以获取电话号码。在此先感谢........
cr = getContentResolver();
contactList = cr.query(ContactsContract.Contacts.CONTENT_URI,null, null, null,null);
if(contactList.getCount() > 0)
{while(contactList.moveToNext())
{id = contactList.getString(contactList. getColumnIndex(ContactsContract.Contacts._ID));
name = contactList.getString(contactList. getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
number = contactList.getString(contactList.
getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
cntctArrayList.add(number);
Log.e("", name);
System.out.println("Contact_id:"+id+"Contact name:"+number);}
}