0

i have a contact number, if the contact exist in phone directory then i want to launch edit contact.

If the contact is fresh, i need to launch the edit contact screen and place the number in appropriate field.

Is there intent like this?

Naruto
  • 9,476
  • 37
  • 118
  • 201

1 Answers1

0

There is no intent for what you intend to do so you have to do it on your own.

Here you have a brief tutorial for inserting and editing a contact using intents.

I guess the best way is looking for the contact using PhoneLookup, if there is no result, send an ACTION_INSERT intent, if there is a result, send an ACTION_EDIT.

In this SO question you can see how to find the contact name from a phone number using PhoneLookup. You can use it for retrieving the id and lookup_key (PhoneLookup reference). But be aware that the phone number isn't unique, so you could get more than one contact.

Community
  • 1
  • 1