title: How to get contact number from contactlist in Android?
body: <p>I want to get contact number from contact list. In Android application on button i want get number from contact list of phone.</p>
  
  <p>Means it click on Select button, &amp; open contact list. it select number, &amp; display in textview.</p>
  
  <p>Please give me a solution.</p>
  
  <pre><code>Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
  startActivityForResult(intent, PICK_CONTACT);
  
  @Override
  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 =  getContentResolver().query(contactData, null, null, null, null);
          if (c.moveToFirst()) {
            String name = c.getString(c.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
            // TODO Whatever you want to do with the selected contact name.
          }
        }
        break;
    }
  }
  </code></pre>