至于您的信息,您可以使用 ContactsContract.Intents.Insert.DATA ,它旨在插入多个数据项。如地址字段的城市、州等。但真正的问题是它在 API 11 之前不可用。
这是它的工作原理。
ArrayList<ContentValues> data = new ArrayList<ContentValues>();
//Email
ContentValues row1 = new ContentValues();
row1.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE);
row1.put(Email.ADDRESS, "ADDRESSme");
data.add(row1);
//Website
ContentValues row2 = new ContentValues();
row2.put(Data.MIMETYPE, Website.CONTENT_ITEM_TYPE);
row2.put(Website.URL, "URLme");
data.add(row2);
//Address
ContentValues row4 = new ContentValues();
row4.put(Data.MIMETYPE, StructuredPostal.CONTENT_ITEM_TYPE);
row4.put(StructuredPostal.CITY, "CityMe");//Pre populating city
row4.put(StructuredPostal.COUNTRY, "COUNTRYme");//Pre populating country
row4.put(StructuredPostal.STREET, "STREETme");////Pre populating street
row4.put(StructuredPostal.POSTCODE, "POSTCODEme");//
data.add(row4);
Intent i = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
i.putParcelableArrayListExtra(Insert.DATA, data);