title: Inserting contacts in Android 2.2
body: <p>I am trying to insert new <code>RawContact</code> contacts, but the <code>RawContact</code> added doesn't get displayed when I view the contacts through Contacts or phonebook. As I understand if we create a <code>RawContact</code> and there is no contact associated with it then the contact will be automatically inserted. I get a valid value of <code>rawContactId</code> and no exceptions are thrown, so I assume the insertion is successful. Am I doing anything wrong or am I missing something? I am using the code example from developer site, just pasting it here:  </p>
  
  <pre><code> ContentValues values = new ContentValues();
   values.put(RawContacts.ACCOUNT_TYPE, accountType); 
   values.put(RawContacts.ACCOUNT_NAME, accountName);
   Uri rawContactUri = getContentResolver().insert(RawContacts.CONTENT_URI, values); 
   long rawContactId = ContentUris.parseId(rawContactUri); 
  
   values.clear(); 
   values.put(Data.RAW_CONTACT_ID, rawContactId); 
   values.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE); 
   values.put(StructuredName.DISPLAY_NAME, "Mike Sullivan"); 
   getContentResolver().insert(Data.CONTENT_URI, values); 
  </code></pre>