title: Not able to access phone number column through contact api (ContactsContract)
body: <p>I am trying to assign an contact cursor to an adapter. I am not able to access it.</p>
  
  <p><strong>It throws below error.
  Unable to start activity java.lang.IllegalArgumentException: column 'data1' does not exist</strong></p>
  
  <p>in line<br>
  *dataAdapter = new SimpleCursorAdapter(this, R.layout.contact_xml, cCursor, columns, to);*</p>
  
  <p>Below is the list view of contacts is what i am trying to achieve through adapter.</p>
  
  <pre><code>---------------------------------------
  Contact_name_1         
  Phone_no
  ---------------------------------------
  Contact_name_2         
  Phone_no2
  ---------------------------------------
  Contact_name_3         
  Phone_no3
  ---------------------------------------
  </code></pre>
  
  <p>Code below.</p>
  
  <pre><code>public class NewContactTest1 extends Activity{
  
      ArrayAdapter&lt;String&gt; adapter;
      private SimpleCursorAdapter dataAdapter;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
      Cursor cCursor = getAllCont();
  
      String[] columns = new String[]{
  
                  ContactsContract.Contacts.DISPLAY_NAME,
                  ContactsContract.CommonDataKinds.Phone.NUMBER
                 };
  
          int[] to = new int[] { 
                  R.id.name,
                  R.id.phnumber
          };
  
      dataAdapter = new SimpleCursorAdapter(this, R.layout.contact_xml, cCursor, columns, to);   // I am getting error in here. 
  
      ListView listView = (ListView) findViewById(R.id.list_view);
      listView.setAdapter(dataAdapter);
      }
  
      public Cursor getAllCont()
      {
          Cursor cursor =
                  getContentResolver().query(ContactsContract.Contacts.CONTENT_URI,
                          null, null, null, null);
           if (cursor != null) 
           {  
               cursor.moveToFirst();
           }
           return cursor;
      }
  </code></pre>
  
  <p>It throws below error.</p>
  
  <p><strong>contact_xml.xml</strong></p>
  
  <pre><code>&lt;RelativeLayout  xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="#FFF"
      android:orientation="horizontal"
      android:padding="5dip"
  &gt;
  
      &lt;TextView 
          android:id="@+id/name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="id"
          android:visibility="invisible"
      /&gt;
      &lt;TextView 
          android:id="@+id/phnumber"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Sent_to"
          android:textColor="#333333"
          android:typeface="serif"
          android:textSize="15dip"
          android:background="#FFF"
      /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>main.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      &gt;
  
    &lt;ListView 
      android:id="@+id/list_view"
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
  
    &gt;&lt;/ListView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>