For one of my apps, I need the user to select one of his existing contacts or to create a new one.
Picking one is clearly easy to do with the following code:
i = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
startActivityForResult(i, PICK_CONTACT_REQUEST );
Now I want to create a new contact. I tried to use that code but it doesn't trigger the activity result:
i = new Intent(Intent.ACTION_INSERT);
i.setType(Contacts.CONTENT_TYPE);
startActivityForResult(i, PICK_CONTACT_REQUEST);
The above code will start the contact adding form. Then when I validate it, it just asks me to open the contact list and the onActivityResult method is never triggered.
Could you help me to make it working ?
I read on some boards that this wasn't possible, and I had to create my own contact adding form. Could you confirm that ?
EDIT: Problem solved. Check my answer.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…