Opening Native Address book in edit mode

153 views Asked by At

I have a raw contact ID for a contact in my application. I want to open the native contact phonebook for editing in my contact (basically the contact in edit mode in native address book). How can I do that?

2

There are 2 answers

0
Amit On

Problem resolved.

I did this with below code

Intent intent = new Intent(Intent.ACTION_EDIT); intent.setData(ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, contactID)); startActivity(intent);

0
Abdul Waheed On

What I understand from your question is that, you have a contact id you want to open that in android native address book against that id. If that is the case then below code should help you

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf("18"));
intent.setData(uri);
startActivity(intent);

In String.valueOf() method provide the contact id you want to open.