title: Contact API storing contact as an invisible contact: How to make it visible?
body: <p>I am trying to add a contact in Android using <code>getContentResolver</code>.
  First I created an <code>ArrayList</code>:</p>
  
  <pre><code>ArrayList&lt;ContentProviderOperation&gt; ops =
    new ArrayList&lt;ContentProviderOperation&gt;();
  </code></pre>
  
  <p>then populated the array list by</p>
  
  <pre><code>int rawContactInsertIndex = ops.size();
  
  ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI)
     .withValue(ContactsContract.RawContacts.ACCOUNT_NAME,accountName)
     .build());
  
  ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
     .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,rawContactInsertIndex)
     .withValue(ContactsContract.Data.MIMETYPE,ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
     .withValue(ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME, name)
     .build());
  </code></pre>
  
  <p>and finally in a try block</p>
  
  <pre><code>getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
  </code></pre>
  
  <p>when I excecute this, I am not getting any error or exception. But the contact does not appear in the Android contacts. When I retrieve the invisible contacts I could find this contact. Can any one figure out what is going wrong?</p>