use of ezvcard.property.Birthday in project qksms by moezbhatti.
the class ContactOperations method convertBirthdays.
private void convertBirthdays(List<NonEmptyContentValues> contentValues, VCard vcard) {
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
for (Birthday birthday : vcard.getBirthdays()) {
Date date = birthday.getDate();
if (date == null) {
continue;
}
NonEmptyContentValues cv = new NonEmptyContentValues(ContactsContract.CommonDataKinds.Event.CONTENT_ITEM_TYPE);
cv.put(ContactsContract.CommonDataKinds.Event.TYPE, ContactsContract.CommonDataKinds.Event.TYPE_BIRTHDAY);
cv.put(ContactsContract.CommonDataKinds.Event.START_DATE, df.format(date));
contentValues.add(cv);
}
}
Aggregations