title: adding custom type of number to a contact [Android]
body: <p>I been working on an app that helps sending sms to your contacts. Everything is great, except that I'm supposed to add a "custom field number" to a contact such as "Work" or "Private". I'd search the web for answers and the ones that are useful for evryone, aren't for me. This is my code:</p>
  
  <pre><code>private void AddCtxtAttribute(int contactID, String contactNumber) {
  
      ArrayList&lt;ContentProviderOperation&gt; ops = new ArrayList&lt;ContentProviderOperation&gt;();
  
      ContentProviderOperation.Builder builder = ContentProviderOperation
              .newInsert(Data.CONTENT_URI);
  
      builder.withValue(Data.RAW_CONTACT_ID, contactID);
      builder.withValue(ContactsContract.Data.MIMETYPE, Phone.CONTENT_ITEM_TYPE);
      builder.withValue(ContactsContract.Data.DATA1, contactNumber);
      builder.withValue(ContactsContract.Data.DATA2, Phone.TYPE_CUSTOM);
      builder.withValue(ContactsContract.Data.DATA3, "My Custom Label");
  
      ops.add(builder.build());
  
      try {
          getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
          Log.e("RESULT", "Success! " + contactID + " - "
                  + contactNumber);
      } catch (RemoteException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          Log.e("ERROR", "error : " + e.toString());
      } catch (OperationApplicationException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          Log.e("ERROR", "error : " + e.toString());
      }
  
  }
  </code></pre>
  
  <p>And it's called:</p>
  
  <pre><code>AddCtxtAttribute(contacto_id, contacto_numero);
  </code></pre>
  
  <p>where contacto_id and contacto_numero are a int and a String respectively.</p>
  
  <p>The problem is that when I pressed the button, I have the ID (contacto_id) of that contact but it updates other contact. (like the id's don't match) but i've debug it and the id doesn't change.</p>
  
  <p>Can anyone help me with this?</p>