// 获取数据库Phones的Cursor
Cursor cur = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
startManagingCursor(cur);
// ListAdapter是ListView和后台数据的桥梁
ListAdapter adapter = new SimpleCursorAdapter(this,
// 定义List中每一行的显示模板
// 表示每一行包含两个数据项
android.R.layout.simple_list_item_2,
// 数据库的Cursor对象
cur,
// 从数据库的NAME和NUMBER两列中取数据
new String[] { PhoneLookup.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.NUMBER},

浙公网安备 33010602011771号