Hi, I am writing the program for reading contacts from android.when i am executing the following code it successfully gets the name but failed to get phone number and showing the ArrayIndexoutofBoundException....The code is
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);
}