我正在写一个程序来读取安卓.when我正在执行以下代码它成功获取名称,但未能获取电话号码并显示ArrayIndexoutofBoundException….代码是
Cursor people = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
while(people.moveToNext())
{
int nameFieldColumnIndex = people.getColumnIndex(PhoneLookup.DISPLAY_NAME);
String contact = people.getString(nameFieldColumnIndex);
contactView.append(contact);
int numberFieldColumnIndex = people.getColumnIndex(PhoneLookup.NUMBER);
String number = people.getString(numberFieldColumnIndex);
contactView.append(number);
}