show company contacts if they have at least company or title filled

This commit is contained in:
tibbi 2018-08-02 16:17:49 +02:00
parent 7b577aa082
commit 7e10bbce6d

View file

@ -380,8 +380,12 @@ class ContactsHelper(val activity: Activity) {
if (cursor?.moveToFirst() == true) {
do {
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
val company = cursor.getStringValue(CommonDataKinds.Organization.COMPANY) ?: continue
val title = cursor.getStringValue(CommonDataKinds.Organization.TITLE) ?: continue
val company = cursor.getStringValue(CommonDataKinds.Organization.COMPANY) ?: ""
val title = cursor.getStringValue(CommonDataKinds.Organization.TITLE) ?: ""
if (company.isEmpty() && title.isEmpty()) {
continue
}
val organization = Organization(company, title)
organizations.put(id, organization)
} while (cursor.moveToNext())