How to read contact name and number from contact list
<p>I'm trying to read contact numbers from users contact list. Here is my code</p>

<pre><code>Cursor cursor = getContacts();
if(cursor.getCount()&gt;0){
    while (cursor.moveToNext()) {
        String displayName = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME));
        int numberField = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
        textViewDisplay.append("Name: ");
        textViewDisplay.append(displayName+"Number :"+numberField);
        textViewDisplay.append("\n");
    }
}
</code></pre>
