0

I need to update a contact name but i didn't way the way to do that with the old contact api (my application must work in 1.5,1.6 AND 2.X)

Arutha
  • 26,088
  • 26
  • 67
  • 80

1 Answers1

0

Ahan well do something like this

Intent i = new Intent(Intent.ACTION_EDIT);

i.setData(Uri.parse("content://com.android.contacts/raw_contacts/1));

//Here 1 is the id of the contact to edit. You can also generate it automatically.

startActivity(i);


If you mean at runtime you want to select id from an text box , you can do something like

Intent i = new Intent(Intent.ACTION_EDIT);

i.setData(Uri.parse("content://com.android.contacts/raw_contacts/" + textBox.getText() ));

//Here textBox should have any numerical value of the contact to edit.

startActivity(i);

Muhammad Shahab
  • 4,187
  • 4
  • 34
  • 44