find the phone number based on name - android
<p>I have a list view with three persons from the contact list . How can I display the phone number of these persons?</p>

<p>Can someone please post a code?</p>

<pre><code>    for (int i=0;i&lt;list.size();i++)
    {
      Log.i("TAG","PHONE NO IS: "+ ......)---------phone number?

      //list.get(i).getName() - is the contact list persons name.

      CounterResolvercr=getCounterResolver();
      Cursor cur= cr.query(ContactsContact.CONTENT_URI,null,null,null);
       while (cur.moveToNext())
       {
        if (cur.getString(cur.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME))== list.get(i).getName())

           {
               String id= cur.getString(cur.getColumnIndex(ContactsContract.Contacts._ID);
                Cursor pcur=cr.quesy(ContactsContact.CommonDataKinds.Phone.CONTENT_URI, null, ContactContract.CommonDataKInds.Phone.CONTACT_ID+"=?",new Strng[]{id},null);

                 while (pCur.moveToNext())
                  {
                  String number =     pCur.getString(pCur.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));

                 Log.d(TAG,number);//IS NOT PRINTING ANYTHING WHY?!!!
                   }
              pcur.close()
                   }
                  }
    }
</code></pre>
