<pre name="code" class="java">list = new ArrayList<Contact>();
Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI;
String name = ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME;
String number = ContactsContract.CommonDataKinds.Phone.NUMBER;
Cursor cursor = getContentResolver().query(uri, new String[]{name, number}, null, null, null);
while (cursor.moveToNext()) {
String nameValue = cursor.getString(0);
String phone = cursor.getString(1);
list.add(new Contact(nameValue, phone));
}
BaseAdapter adapter = new ContactAdapter();
listView.setAdapter(adapter);
权限
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>