|
intent.putParcelableArrayListExtra(DATA, dataList); |
|
|
|
intent.putExtra(ContactsContract.Intents.Insert.COMPANY, contactInfo.getOrganization()); |
|
|
|
|
|
Email[] emailList = contactInfo.getEmails(); |
|
|
|
dataList = new ArrayList<>(); |
|
for (Email email : emailList) { |
|
ContentValues row = new ContentValues(); |
|
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE); |
|
row.put(ContactsContract.CommonDataKinds.Email.ADDRESS, email.getAddress()); |
|
row.put(ContactsContract.CommonDataKinds.Email.TYPE, Utils.convertEmailType(email.getType())); |
|
dataList.add(row); |
|
} |
|
intent.putParcelableArrayListExtra(DATA, dataList); |
|
|
|
|
|
String[] urlList = contactInfo.getUrls(); |
|
dataList = new ArrayList<>(); |
|
|
|
for (String url: urlList) { |
|
ContentValues row = new ContentValues(); |
|
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE); |
|
row.put(ContactsContract.CommonDataKinds.Website.URL, url); |
|
dataList.add(row); |
|
|
|
} |
|
|
|
intent.putParcelableArrayListExtra(DATA, dataList); |
|
|
|
Address[] addresses = contactInfo.getAddresses(); |
|
dataList = new ArrayList<>(); |
|
|
|
for (Address address: addresses) { |
|
ContentValues row = new ContentValues(); |
|
row.put(ContactsContract.Data.MIMETYPE, ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE); |
|
row.put(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS, address.getStringRepresentation()); |
|
dataList.add(row); |
|
|
|
} |
|
|
|
intent.putParcelableArrayListExtra(DATA, dataList); |