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)
Asked
Active
Viewed 1,049 times
1 Answers
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
-
Can you explain me more, because the answer i have posted will do it programmatically – Muhammad Shahab Nov 12 '10 at 07:53
-
I don't want to display a new activity. – Arutha Nov 12 '10 at 10:35