Android Question ContactUtils Last Name

slowtime

Active Member
Licensed User
Longtime User
Hi,
contactUtils
Public Sub InsertContact(Name As String, Phone As String) As cuContact
let you insert only the name and phone of new contact.

How to insert Last Name, Second Name and Title ?

Thank you in advance.
Ciao
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Edit ContactUtils class. Find this code in InsertContact:
B4X:
values.Initialize
   values.PutLong("raw_contact_id", rawContactId)
   values.PutString("mimetype", "vnd.android.cursor.item/name")
   values.PutString("data1", Name)
This code sets the "display name" field.

You can add other fields. For example to add the family name: http://developer.android.com/refere...mmonDataKinds.StructuredName.html#FAMILY_NAME

B4X:
values.PutString("data3", "<Family Name>")
 
Upvote 0
Top