title: Setting MIMETYPE of Data for ContactsContract in Adapter or Fragment
body: <p>In my application I am seeking to display contact details of </p>
  
  <pre><code>ContactsContract.CommonDataKinds.Organization.TITLE
  </code></pre>
  
  <p>Within the ContactsContract, the MIMETYPE is used to choose the identity of the column of most of the useful data from the phone.</p>
  
  <p>I am seeking to display the job title of the contacts in my listview. I have used the SQL Injection of IN for the WHERE/SELECTION clause with the code below.</p>
  
  <pre><code> private static final String SELECTION =
              ContactsContract.RawContactsEntity.MIMETYPE + " IN ('" +
              ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE + "')";
  </code></pre>
  
  <p>This works however because it is in the where clause it removes items that do not have a value here which largely minimizes the number of item in the list. </p>
  
  <p>Like mentioned above I'm seeking to find how to set the MIMETYPE of the cursor either in my CursorLoader or in the my CursorAdapter.</p>
  
  <p>The binding adapter method looks like this</p>
  
  <pre><code>public void onBindViewHolder(ContactsViewHolder viewHolder, Cursor cursor) {
      String profession = cursor.getString(cursor.getColumnIndex(ContactsContract.CommonDataKinds.Organization.TITLE));
      String contactID = cursor.getString(cursor.getColumnIndex( ContactsContract.Data.CONTACT_ID));
      Uri contactURI = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI,
              Integer.parseInt(contactID));
      viewHolder.setProfession(profession);
      viewHolder.setURI(contactURI);
  </code></pre>
  
  <p>The CursorLoader simply looks like this. FROM_COLUMNS contains basic data including </p>
  
  <pre><code> ContactsContract.CommonDataKinds.Organization.TITLE
  
  
   return new CursorLoader(
                          getContext(),
                          ContactsContract.Data.CONTENT_URI,
                          FROM_COLUMNS,
                          null,
                          null,
                          null
                  );
  </code></pre>