Plus union

xiaoxiao2021-03-06  99

_LIT (KNameLabel, "Name"); _ LIT (kmobilelabel, "mobile"); _ lit (kname, "steve"); _ lit (kmobile, " 8613900000000");

// Open the default contacts database: CContactDatabase * contactsDb = CContactDatabase :: OpenL (); CleanupStack :: PushL (contactsDb); // Create a contact card and add some fields: CContactItem * contact = CContactCard :: NewLC (); CContactItemField * Field = ccontactItemfield :: Newlc (kstoRaGTypetext, kuidcontactfieldfamilyname);

Field-> setmapping (kuidcontactfieldvcardmapunusedn); Field-> setLabell (KNameLabel); Field-> TextStorage () -> setTextL (kname); Contact-> addfieldl (* field); cleanupstack :: Pop ();

field = CContactItemField :: NewLC (KStorageTypeText, KUidContactFieldPhoneNumber); field-> SetMapping (KUidContactFieldVCardMapTEL); field-> SetLabelL (KMobileLabel); field-> TextStorage () -> SetTextL (KMobile); contact-> AddFieldL (* field); Cleanupstack :: POP ();

// add the new contact to the database and set it as the w, contactsdb-> addnewcontact1; contactsdb-> setownloadcardl (* contact); Cleanupstack :: popandDestroy (2); // Contact ContactSDB

转载请注明原文地址:https://www.9cbs.com/read-124349.html

New Post(0)