0

I need to update the Label email address on phone book of android. Anyone know how i can do this?

Here is my code

String stEtEmail = etEmail.getText().toString();  //EMAIL
String stBtnLabelEmail = etBtnLabelEmail.getText().toString();  //**LABEL**
values.clear();
String mailWhere = ContactsContract.Data.CONTACT_ID + "=? AND " + ContactsContract.Data.MIMETYPE + "=?"; 
String[] mailWhereParams = new String[]{String.valueOf(idContacto),ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE}; 
values.put(ContactsContract.CommonDataKinds.Email.DATA,stEtEmail);

cr.update(ContactsContract.Data.CONTENT_URI, values, mailWhere, mailWhereParams);

I don't know how i can update the my label of email.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
Ricardo Filipe
  • 435
  • 4
  • 8
  • 24
  • Just to check: You want to change the text of the label "Email Address" from the current android contacts app? As in the one that is provided by the OS? This isn't possible using code. On the other hand you can create a custom label for an email address or a phone number by choosing custom from the list when inputting the email to the edit contact page. – Michael Allen Aug 20 '12 at 11:02
  • Hello Michael. I have an application with contacts. And i want to update contacts information in phone book of android. I update the email adress without problem and i want to udate the label of that email address. :) – Ricardo Filipe Aug 20 '12 at 11:10

1 Answers1

0

I have get the solution:

     values.put(ContactsContract.CommonDataKinds.Email.TYPE,ContactsContract.CommonDataKinds.Email.TYPE_HOME);  //TYPE_WORK  TYPE_HOME.......
     values.put(ContactsContract.CommonDataKinds.Email.LABEL,stBtnLabelEmail);
Ricardo Filipe
  • 435
  • 4
  • 8
  • 24