title: Illegal Argument Exception in Email column doesn't exist
body: <p>I am fetching Contact Name, Contact Number, Contact Email from device phone book. Till now I was fetching contact name and number and it was working fine. Now I am trying to add even email to name and number. But I am getting illegal arguments exception. please let me know what am I doing wrong here. Below is my query:</p>
  
  <pre><code>cursor1 = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null, null, null, null);
          String[] from = {ContactsContract.CommonDataKinds.Phone.NUMBER, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, String.valueOf(ContactsContract.CommonDataKinds.Email.CONTENT_URI), ContactsContract.CommonDataKinds.Phone._ID};
          int[] to = {R.id.textViewName, R.id.textViewNumber, R.id.textViewEmail};
          myCursorAdapter = new SimpleCursorAdapter(getBaseContext(), R.layout.custom_spinner_row, cursor1, from, to, 0);
  </code></pre>
  
  <p>I am population these three details by means of a spinner:</p>
  
  <pre><code>contacts1 = (Spinner) findViewById(R.id.spinnerContacts);
          contacts1.setAdapter(myCursorAdapter);
  
  contacts1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
              @Override
              public void onItemSelected(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
                  Toast.makeText(getApplicationContext(), "The value of Position selected is " + position, Toast.LENGTH_LONG).show();
                  Cursor selectedCursor = (Cursor) parent.getItemAtPosition(position);
                contactNumber = selectedCursor.getString(selectedCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
                   contactName = selectedCursor.getString(selectedCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
                   contactEmail = selectedCursor.getString(selectedCursor.getColumnIndex(String.valueOf(ContactsContract.CommonDataKinds.Email.CONTENT_URI)));
  
  
                  Log.d("Pana", "The value of strNumber is " + contactNumber);
                  Log.d("Pana", "The value of strName is " + contactName);
  
  
              }
  
              @Override
              public void onNothingSelected(AdapterView&lt;?&gt; parent) {
  
              }
          });
  </code></pre>
  
  <p>Schema of my database:</p>
  
  <pre><code>public static final String DATABASE_NAME = "task_management_database";
      public static final String TABLE_NAME = "DataTable";
      public static final String UID = "_id";
      public static final String TABLE_NAME_CHILD = "ChildDataTable";
      public static final String UIDCHILD = "_idchild";
      public static final String TASK_NAME = "Task_name";
      public static final String SUB_TASK_NAME = "Sub_Task_name";
      public static final String CONTACT_NAME = "Contact_Name";
      public static final String CONTACT_NUMBER = "Contact_Number";
      public static final String CONTACT_EMAIL = "Contact_Email";
      public static final String DESCRIPTION = "Description";
      public static final String REMARKS = "Remarks";
      public static final String DATE = "Date";
      public static final String TIME = "Time";
      public static final String ESTIMATED_COMPLETION_DATE = "EstCompDate";
      public static final String ESTIMATED_COMPLETION_TIME = "EstCompTime";
      public static final String ACTUAL_COMPLETION_DATE = "ActCompDate";
      public static final String ACTUAL_COMPLETION_TIME = "ActCompTime";
      public static final String NOTIFY_DATE = "NotifyDate";
      public static final String NOTIFY_TIME = "NotifyTime";
      public static final int DATABASE_VERSION = 1;
      public static final String SUB_TASK_NUMBER = "sub_task_number";
      public static final String CREATE_TABLE = " CREATE TABLE " + TABLE_NAME +
              "(" + UID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + TASK_NAME + " VARCHAR(250)," + CONTACT_NAME + " VARCHAR(250)," + CONTACT_NUMBER + " VARCHAR(250),"
              + CONTACT_EMAIL + " VARCHAR(250)," + DESCRIPTION + " VARCHAR(250), " + REMARKS + " VARCHAR(250),"
              + DATE + " VARCHAR(250)," + TIME + " VARCHAR(250)," + ESTIMATED_COMPLETION_DATE + " VARCHAR(250), " + ESTIMATED_COMPLETION_TIME + " VARCHAR(250), "
              + ACTUAL_COMPLETION_DATE + " VARCHAR(250), " + ACTUAL_COMPLETION_TIME + " VARCHAR(250), " + NOTIFY_DATE + " VARCHAR(250), " + NOTIFY_TIME + " VARCHAR(250) );";
  </code></pre>
  
  <p>My Adb trace:</p>
  
  <pre><code>03-06 12:06:24.369      687-702/android.process.acore E/SQLiteLog﹕ (284) automatic index on sqlite_sq_A7126FB0(STAT_DATA_ID)
  03-06 12:06:24.467    1323-1323/com.ms.t.tms E/Cursor﹕ requesting column name with table name -- content://com.android.contacts/data/emails
      java.lang.Exception
              at android.database.AbstractCursor.getColumnIndex(AbstractCursor.java:279)
              at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:301)
              at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:78)
              at android.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:333)
              at android.widget.SimpleCursorAdapter.&lt;init&gt;(SimpleCursorAdapter.java:107)
              at com.ms.t.tms.InsertActivity.onCreate(InsertActivity.java:74)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  03-06 12:06:24.502    1323-1323/com.ms.t.tms D/AndroidRuntime﹕ Shutting down VM
  03-06 12:06:24.517    1323-1323/com.ms.t.tms E/AndroidRuntime﹕ FATAL EXCEPTION: main
      Process: com.ms.t.tms, PID: 1323
      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ms.t.tms/com.ms.t.tms.InsertActivity}: java.lang.IllegalArgumentException: column 'content://com.android.contacts/data/emails' does not exist
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
       Caused by: java.lang.IllegalArgumentException: column 'content://com.android.contacts/data/emails' does not exist
              at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:303)
              at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:78)
              at android.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:333)
              at android.widget.SimpleCursorAdapter.&lt;init&gt;(SimpleCursorAdapter.java:107)
              at com.ms.t.tms.InsertActivity.onCreate(InsertActivity.java:74)
              at android.app.Activity.performCreate(Activity.java:5933)
              at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
              at android.app.ActivityThread.access$800(ActivityThread.java:144)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5221)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  </code></pre>
  
  <p>The error points to myCursorAdapter line. I feel the error is in cursor1 line. But I am not sure. Please help me solve this problem. All suggestions are welcome. Thanks in advance.</p>