问题
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)
回答1:
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);
来源:https://stackoverflow.com/questions/4147740/android-update-contact-name