pick contacts with same name and more than two number
<p>I have tried to pick the contacts from phone by using following method in my project.It working fine.....But in some case i will not work...For Ex: In case of Same Name with More than one number like personal/Home..In this stage it will pick only first number.so i am unable to pick contacts from me. kindly give solutions.....</p>

<p>entered code here</p>

<pre><code> public void onActivityResult(int reqCode, int resultCode, Intent data) {
 super.onActivityResult(reqCode, resultCode, data);

 switch (reqCode) {
 case (PICK_CONTACT) :
   if (resultCode == Activity.RESULT_OK) {

     Uri contactData = data.getData();
     Cursor c =  managedQuery(contactData, null, null, null, null);
     if (c.moveToFirst()) {


         String id =c.getString(c.getColumnIndexOrThrow(ContactsContract.Contacts._ID));

         String hasPhone =c.getString(c.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));

           if (hasPhone.equalsIgnoreCase("1")) {
          Cursor phones = getContentResolver().query( 
                       ContactsContract.CommonDataKinds.Phone.CONTENT_URI,null, 
                       ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ id, 
                       null, null);
             phones.moveToFirst();
             cNumber = phones.getString(phones.getColumnIndex("data1"));

             System.out.println("number is:"+cNumber);
           }
         /*name = c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));

         Textcontact.setText(name);*/

         edt.setText(cNumber);

     }
   }
   break;
 }
 }
</code></pre>

<p>Thanks...</p>
