show company contacts if they have at least company or title filled
This commit is contained in:
parent
7b577aa082
commit
7e10bbce6d
1 changed files with 6 additions and 2 deletions
|
|
@ -380,8 +380,12 @@ class ContactsHelper(val activity: Activity) {
|
||||||
if (cursor?.moveToFirst() == true) {
|
if (cursor?.moveToFirst() == true) {
|
||||||
do {
|
do {
|
||||||
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
|
val id = cursor.getIntValue(ContactsContract.Data.RAW_CONTACT_ID)
|
||||||
val company = cursor.getStringValue(CommonDataKinds.Organization.COMPANY) ?: continue
|
val company = cursor.getStringValue(CommonDataKinds.Organization.COMPANY) ?: ""
|
||||||
val title = cursor.getStringValue(CommonDataKinds.Organization.TITLE) ?: continue
|
val title = cursor.getStringValue(CommonDataKinds.Organization.TITLE) ?: ""
|
||||||
|
if (company.isEmpty() && title.isEmpty()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
val organization = Organization(company, title)
|
val organization = Organization(company, title)
|
||||||
organizations.put(id, organization)
|
organizations.put(id, organization)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue