title: "SQLiteException: no such column: mimetype" when using ContactsContract in Android
body: <p>I want to delete an entry from Android's internal database table <code>ContactsContract</code>, i.e. an event such as a birthday should be removed from the contact's entry.</p>
  
  <p>The following code works pretty well, but some users (ca. 1%) have this crashing with an <code>SQLException</code>. So is there anything wrong in my code or is it just that their device doesn't support Android's <code>ContactsContract</code> correctly?</p>
  
  <pre><code>try {
      ArrayList&lt;Long&gt; rawContactIDs = getRawContactID(o.getID());
      int rawContactCount = rawContactIDs.size();
      for (int r = 0; r &lt; rawContactCount; r++) {
          long rawContactID = rawContactIDs.get(r);
          String where = ContactsContract.Data.MIMETYPE+" = ? AND "+ContactsContract.Data.RAW_CONTACT_ID+" = ? AND "+ContactsContract.CommonDataKinds.Event.TYPE+" = ?";
          String[] selection = new String[] { ContactsContract.CommonDataKinds.Event.CONTENT_ITEM_TYPE, String.valueOf(MY_RAW_CONTACT_ID), String.valueOf(ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY) };
          getContentResolver().delete(ContactsContract.Data.CONTENT_URI, where, selection);
      }
  }
  catch (Exception e) {}
  </code></pre>
  
  <p>The exception that is thrown is:</p>
  
  <pre><code>android.database.sqlite.SQLiteException: no such column: mimetype: , while
  compiling: DELETE FROM data WHERE mimetype = ? AND raw_contact_id = ? AND
  data2 = ?
  at
  android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:158)
  at
  android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
  at
  android.content.ContentProviderProxy.delete(ContentProviderNative.java:472)
  at android.content.ContentResolver.delete(ContentResolver.java:700)
  at ... MY_ACTIVITY ...
  </code></pre>