Open "Add Contact Screen" with names already set

I'm trying to open the 'Add Contact' screen via an intent, and I want it with the names already set (first name and family name).

For that, I'm trying to do this:

Intent intent = new Intent(Intent.ACTION_INSERT); intent.setType(ContactsContract.Contacts.CONTENT_TYPE); intent.putExtra(ContactsContract.Intents.Insert.NAME, "My Name"); intent.putExtra(ContactsContract.Intents.Insert.PHONETIC_NAME, "Family Name"); intent.putExtra(ContactsContract.Intents.Insert.PHONE, "12345")); activity.startActivityForResult(intent, 2);

In this case, the second field in the 'Add Contact' screen keeps empty, and a new field appears with the string "Family Name", that's because I've set the PHONETIC_NAME.

What I want to know is, how do I add the family name value to the second field in 'Add Contact' screen?



I've searched for this question but it doesn't solve. It uses some kind of vCards. I don't know anything about it, if this is the right way to implement this, can someone help me understand how to implement it?

-------------Problems Reply------------

Try this:

Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);

intent.putExtra(ContactsContract.Intents.Insert.NAME, "FirstName MiddleName LastName");
intent.putExtra(ContactsContract.Intents.Insert.PHONE, "12345");

startActivityForResult(intent, 2);

;) Goodluck

Category:android Views:0 Time:2011-10-14
Tags: android

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.201 (s). 11 q(s)