mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show company contacts if they have at least company or title filled
This commit is contained in:
@ -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())
|
||||||
|
Reference in New Issue
Block a user